Account Names

면접 대비

시간 제한1초메모리 제한1024 MB

요약
이름과 성을 연결한 표, 이름과 계정을 연결한 표가 주어질 때 각 참가자의 성과 계정을 짝지어 출력한다.
난이도

쉬움10점 중 3점

유형
해시맵, 배열
정답자
아직 제출이 없습니다

문제

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 (1≤N≤201 \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

  1. 예제 1

    입력
    3
    Juku Kask
    Mann Kuusk
    Mikk Tamm
    Mikk mt
    Juku jk
    Mann mk
    
    예상 출력
    Kuusk mk
    Tamm mt
    Kask jk