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(A[B[i]]+1,end=" ")