Logo
(追記) (追記ここまで)

31336번 - The simplest problem about cubes 스페셜 저지다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
2 초 1024 MB21150.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:

John All numbers are represented as dots
David Numbers are never written as roman numerals
Peter All faces are white
Robert Faces of the cube are either black or white
Mark Odd numbers have white background, even numbers have black background
Paul All prime numbers are written as decimal, and vice versa
Patrick All face have the same color, but neither black nor white
Jack All roman numerals are on the yellow background
Max All faces have unique colors
Alex Numbers of the same format have the same background, different formats have different colors

입력

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:

  1. From 1ドル$ to 6ドル$ <<.>> symbols (ASCII 46ドル$), which means that number is written with dots and the number equals to the number of this dots;
  2. Decimal number from 1ドル$ to 6ドル$;
  3. Roman numeral, written with <<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.

제한

예제 입력 1

W ..
W ...
W ....

예제 출력 1

John David Peter Robert Jack Alex

예제 입력 2

B 2
W 3
B 6

예제 출력 2

David Robert Mark Jack 

예제 입력 3

G 1
G 2
G V

예제 출력 3

Patrick

예제 입력 4

G 2
G 3
Y ....

예제 출력 4

David Paul Jack Alex

예제 입력 5

W .
B 2
W III

예제 출력 5

Robert Mark

힌트

출처

Contest > Open Cup > 2014/2015 Season > Stage 9: Grand Prix of Udmurtia A번

(追記) (追記ここまで)

출처

대학교 대회

  • 사업자 등록 번호: 541-88-00682
  • 대표자명: 최백준
  • 주소: 서울시 서초구 서초대로74길 29 서초파라곤 412호
  • 전화번호: 02-521-0487 (이메일로 연락 주세요)
  • 이메일: contacts@startlink.io
  • 통신판매신고번호: 제 2017-서울서초-2193 호

AltStyle によって変換されたページ (->オリジナル) /