407664: GYM102868 B Blue

Memory Limit:256 MB Time Limit:1 S
Judge Style:Text Compare Creator:
Submit:0 Solved:0

Description

B. Bluetime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard output

Blue had a few seconds to stop and do wires in Storage before getting on with the rest of his investigation into the rest of the crew. Blue can complete wires by connecting wires between the wire slots of the same color together. However, it seems like the wire configuration that he has been given is a little more complicated than normal, and he might need additional help to figure out the desired wire pairings.

You will be given two sets of colored wire slots, represented by alphabetic characters (that could be uppercase or lowercase). You are guaranteed that all colored wire slots are distinct and any colored wire slots in the first set will be accompanied by a wire slot with the same color on the second set.

For each colored wire slot in the first set, you must figure out the one-based index of that colored wire slot in the second set so that Blue can connect the two slots. Print out all these one-based indexes together (not separated by anything).

Input

The first line will consist of a single integer $$$n$$$ ($$$1 \leq n \leq 52$$$), which gives the number of wire slots in each set. The next line consists of a string with $$$n$$$ distinct alphabetic characters that represent the first set of colored wire slots. The next line consists of a string with the same $$$n$$$ distinct alphabetic characters that represent the next set of colored wire slots.

Output

Print out the one-based index of the colored wire slot in the second set for each colored wire slot in the first set, separated by nothing.

ExamplesInput
4
RYGB
BGRY
Output
3421
Input
15
bWLQefvOKuJpxGm
vKeQpJfbmLxGWOu
Output
813104371142156511129
Note

The first test case gives us the indices $$$[3, 4, 2, 1]$$$. The second test case gives us the indices $$$[8, 13, 10, 4, 3, 7, 1, 14, 2, 15, 6, 5, 11, 12, 9].$$$

加入题单

算法标签: