A=list(map(int,input().split())) B=list(map(int,input().split())) for i in range(5): A[i]-=1 B[i]-=1 for i in range(5): print(B[A[i]]+1,end=" ")