e-olymp
Problems

Mysterious Note

Mysterious Note

prb378 Recently, Masha and Katya have learned that there is evil in the world of hackers, which can easily reveal the strange correspondence. So they decided to send only encrypted messages. For this purpose, friends began to use the permutation code, where each letter is replaced by another. For example:

Encoded message: HPC PJVYMIY

Decode the message: ACM CONTEST

In this example, the following replacement: H = A, P = C, C = M, J = O, V = N, Y = T, M = E and I = S.

In order not to engage in hand-coding and decoding, a friend asked you to write the program. Help girls!

Input

In the first line of input is written coded message. Second line - 26 Latin uppercase letters representing the code for the corresponding symbol alphabet: the first character gives the code for A, B for second and so on. To be used only uppercase letters. In an encoded message may appear gaps that must be stored in the output string.

Output

In the output file display one line, which contains the decoded message.
Time limit 1 second
Memory limit 64 MiB
Input example
Sample 1
HPC PJVYMIY 
BLMRGJIASOPZEFDCKWYHUNXQTV 

Sample 2
FDY GAI BG UKMY 
KIMHOTSQYRLCUZPAGWJNBVDXEF
Output example
Sample 1
ACM CONTEST 

Sample 2
THE SKY IS BLUE 
Source Отборочный тур Всероссийской командной олимпиады школьников 2009/2010 учебный год