The simplest problem about cubes
시간 제한2초메모리 제한1024 MB
큐브의 보이는 세 면이 색과 숫자 표기 형식으로 주어질 때, 각 수집가의 규칙에 따라 이 큐브를 소유할 수 있는 사람을 가려낸다.
문제
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 faces. Each face has a single number written on it from to , 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 th line () --- the color of 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:
- From to <<
.>> symbols (ASCII ), which means that number is written with dots and the number equals to the number of this dots; - Decimal number from to ;
- Roman numeral, written with <<
I>> (ASCII ) and <<V>> (ASCII ) 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.