Hide

Problem O
QWERTY

Riley is a very fast typist. She can easily reach $180$ words per minute (WPM) without looking at the keyboard. Her muscle memory is accustomed to the standard QWERTY keyboard layout (Figure 1). Unfortunately, she didn’t realize that the keyboard she was typing on was actually the ABCDEF layout (Figure 2), so her message looks like gibberish.

For example, if her message read visidkmi lvpiis in zhycl, then what she actually wanted to type was colorado school of mines. Note that the space key is in the same position on both keyboards. This example corresponds to Sample Input 1.

Given an arbitrary message, can you figure out what Riley was trying to type?

\includegraphics[width=0.75\textwidth ]{keyboard_qwerty}
Figure 1: The standard QWERTY layout that Riley thought she was using. Made with www.keyboard-layout-editor.com.
\includegraphics[width=0.75\textwidth ]{keyboard_abcdef}
Figure 2: The ABCDEF layout keyboard that Riley actually used. Made with www.keyboard-layout-editor.com.

Input

The first line of input is an integer, $1 \leq N \leq 1\, 000$, corresponding to the number of characters in the second line.

The second line of input is the text Riley typed with the ABCDEF keyboard. It is guaranteed to contain only the lowercase letters az and the space character.

Output

Your output should be a single line: the text Riley was trying to type.

Sample Input 1 Sample Output 1
24
visidkmi lvpiis in zhycl
colorado school of mines
Sample Input 2 Sample Output 2
43
epc aghvr xdiby niu qgzjl iwcd epc sktf mio
the quick brown fox jumps over the lazy dog

Please log in to submit a solution to this problem

Log in