| 시간 제한 | 메모리 제한 | 제출 | 정답 | 맞힌 사람 | 정답 비율 |
|---|---|---|---|---|---|
| 1 초 | 1024 MB | 114 | 111 | 98 | 97.030% |
John is preparing for the olympiad and needs a table listing the last name and the account name of each participant. He has a table listing the first name and the last name of each participant, and another one listing the first name and the account name of each participant. Looking at the data, John notices that all the $N$ first names are distinct, and so are all the $N$ last names and also all the $N$ account names.
Write a program to compile the table John needs.
The first line contains an integer $N,ドル the number of participants (1ドル \le N \le 20$).
Each of the following $N$ lines (starting from the second line) contains two space-separated strings: the first name and the last name of one participant.
Each of the following $N$ lines (starting from the line $N+2$) contains two space-separated strings: the first name and the account name of one participant.
Each name consists of 1 to 20 letters of the Latin alphabet. Usernames consist of lower-case letters only. Each first name and each last name starts with an upper-case letter, followed by lower-case letters only.
Output exactly $N$ lines, one line for each participant. Each line should contain the last name and the account name of one participant, separated by a space. The lines may be in any order.
3 Juku Kask Mann Kuusk Mikk Tamm Mikk mt Juku jk Mann mk
Kuusk mk Tamm mt Kask jk