With Christmas rapidly approaching, you have planned gifts for your friends and secured a Christmas tree. However, you cannot forget about your own gift! You have created a wishlist consisting of
1 | 2 | 3 | 4 | 5 | |
---|---|---|---|---|---|
A | q | w | a | r | t |
B | y | u | i | o | p |
C | e | s | d | f | g |
D | h | j | k | l | x |
E | c | v | b | n | m |
The coded version of a character consists of its coordinates like so: [letter, number]. For example, the coded version of the letter b
would be E3
. By this logic, words can be coded and decoded. For example, the word bike
would be E3B3D3C1
when encoded. Note that any cipher will always contain 25 letters, meaning that one letter will always be missing. This excluded letter will not be encoded in the list. For example, E3zB3D3C1
would translate to bzike
.
Your job is to create a program that, given the cipher in the form of a
Constraints
Note: It is guaranteed that all strings
Subtask 1 [40%]
The items in the list will not contain the excluded letter from the cipher.
Subtask 2 [60%]
No additional constraints.
Input Specification
The first line will contain a single integer,
The next five lines will contain the cipher: each line will contain five space-separated characters representing a row of the grid.
The next
Output Specification
The output should consist of
Sample Input
Note: You will not be required to pass this sample case to progress to the subtasks.
4
q w a r t
y u i o p
e s d f g
h j k l x
c v b n m
E3B3D3C1
E2B3C3C1B4C5A3E5C1
C2A2C1A3A5C1A4
E3zB3D3C1
Sample Output
bike
videogame
sweater
bzike
Explanation of Sample
The cipher given in this case corresponds to the example given in the problem statement. Using the coding system explained shows that each decoded version corresponds to the coded ones in the input.
Comments