BAC and SAC are at war!
You, an intelligence officer, are tasked with deciphering encrypted messages that were intercepted from the belligerent club.
You know that the enemy uses a very simple encryption system. First, they will get any ordinary string that is characters long consisting of only uppercase letters and then scramble it. To unscramble the message, the receiver will use a cypher to decrypt the message. The cypher is simply a list of numbers which provide the original order the scrambled letters appeared in.
Fortunately, you just so happen to have that cypher in your possession, all that is left is to decrypt the message.
Constraints
Subtask 1 [50%]
Subtask 2 [50%]
No additional constraints.
Input Specification
The first line of input will contain .
The second line of input will contain uppercase letters, each separated by a space.
The third line of input will contain a permutation of the first positive integers.
Output Specification
Output the original unscrambled message.
Sample Input
6
M O A U S G
2 3 1 5 6 4
Sample Output
AMOGUS
Comments