| tumi ke ami ke | garo chakma bangali |
Prince also joined with this mass people. When it was too late, Princess got worried about Prince. So she also went out. After some while, she found Prince on a tree at Shahbag yelling slogans in strong voice. Instead of getting mad, Princess asked Prince what are the slogans. So Prince told her a few slogans, first line and corresponding second line. So Princess got prepared. Given the list of the slogans and also the first lines Princess going to hear, print out the second line of the slogans.
First line contains number of slogans, N (0 < N ≤ 20) Prince is going to teach Princess. Hence follows N pairs of lines. First line of the pair contains first line of a slogan and the second line of the pair is corresponding second line of the slogan. Then another positive integer Q will be given (Q ≤ 100). Hence follows Q lines. Each line contains first line of a slogan. You may assume that the slogans will contain lower case English alphabet and/or space. Both the lines of slogan will contain at least one alphabet. No two first lines in the Princes slogan list will be same. Each slogan will be at most 100 characters long. All of the query first line will be in Princes list.
For each of the first line of the slogan, you need to print out corresponding second line.