| 시간 제한 | 메모리 제한 | 제출 | 정답 | 맞힌 사람 | 정답 비율 |
|---|---|---|---|---|---|
| 2 초 | 1024 MB | 2 | 1 | 1 | 50.000% |
Yesterday Taja visited the museum. The tour was long and interesting, but the room she liked most contained collections of the cubes of the ten famous collectors. One of the cubes has attracted her attention a lot, but she forgot, who has possessed it. Nevertheless she memorized how three visible faces looked like, as well as criteria of each of the collector. You are to deduce the name of the collectors, who could possess such a cube, from this information.
Each cube has 6ドル$ faces. Each face has a single number written on it from 1ドル$ to 6ドル,ドル unique for each face. Numbers can be represented either by dots, or as a decimal or as roman numeral. Also each face has one of the following colors --- Black, White, Green, Yellow, Skyblue, Red, Orange and Purple.
Here is the list of the names of the collectors and their corresponding criteria, which hold for the entire collection:
Input contains three lines, describing visible faces of the cube.
First symbol of $i$th line $c_i$ ($c_i \in \{B, W, G, Y, S, R, O, P\}$) --- the color of $i$th face (Black, White, Green, Yellow, Skyblue, Red, Orange and Purple correspondingly). The, separated by space, follows the number written on the face, in one of the following formats:
.>> symbols (ASCII 46ドル$), which means that number is written with dots and the number equals to the number of this dots;I>> (ASCII 73ドル$) and <<V>> (ASCII 86ドル$) symbols.It is guaranteed, that presented cube belongs to at least one collector.
Output should contain a single line with name of collectors, which can own this given cube. Names should be written in any order and separated by space.
All names of the collectors should be from the following list: John, David, Peter, Robert, Mark, Paul, Patrick, Jack, Max, Alex.
W .. W ... W ....
John David Peter Robert Jack Alex
B 2 W 3 B 6
David Robert Mark Jack
G 1 G 2 G V
Patrick
G 2 G 3 Y ....
David Paul Jack Alex
W . B 2 W III
Robert Mark