cho.sh
NotesCho Mini
Loading...

Secret Letter

Time limit

1s

Memory limit

128 MB

Problem

Every day, Byunghyun sends Jieuni a secret letter made of the letters A through H. Each letter is represented by a 6-bit code made of 0s and 1s.

LetterCode
A000000
B001111
C010011
D011100
E100110
F101001
G110101
H111010

If a communication error occurs, at most one digit in the 6-bit code for a single letter may arrive incorrectly. Jieuni interprets a received 6-bit code as a letter when it is exactly equal to that letter's code, or when it differs from that code in exactly one position.

If the received code differs from every code in the table by at least two positions, that letter cannot be identified. Split the received letter into 6-bit chunks from the front. If every chunk can be identified, print the decoded string. Otherwise, print the 1-based position of the first chunk that cannot be identified.

Input

The first line contains the number of sent letters, N. N is less than 10.

The second line contains a string of length 6N. The string consists only of 0s and 1s.

Output

If the entire received letter can be decoded, print the string Jieuni understands.

If there is a chunk that cannot be identified, print the position of the first such chunk.