Account Names | 프로그래밍의 벗 PivotOJ
PivotOJ

Account Names

시간 제한: 1000ms메모리 제한: 1024MB출처: EIO 2020-21 openBOJ 29881

문제

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 NN first names are distinct, and so are all the NN last names and also all the NN account names.

Write a program to compile the table John needs.

입력

The first line contains an integer NN, the number of participants (1N201 \le N \le 20).

Each of the following NN 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 NN lines (starting from the line N+2N+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 NN 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.

예제

예제 1

입력
3
Juku Kask
Mann Kuusk
Mikk Tamm
Mikk mt
Juku jk
Mann mk
출력
Kuusk mk
Tamm mt
Kask jk
코드를 제출하려면 로그인하세요.