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
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
The third line of input will contain a permutation of the first
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