Start: Jul, 06, 2019 10:00:00
20190706Python程序设计基础培训扩展练习
End: Jul, 17, 2019 12:00:00
Time elapsed:
Time remaining:

Problem_ID: E
Result: Accepted
Time: 46ms
Memory: 25312kB
Author: 13867179686
In contest: 1300

t,n=map(int,input().split())
dic={}
for tcase in range(t):
    s=input().split()
    dic[s[0]]=s[1]
pw=''
for ncase in range(n):
    a=input()
    pw+=dic.get(a)+' '
print(pw[:-1])