*a,=map(int,input().split()) i=1 while 1: b=input() print(b) if i in a:print(b) i+=1