A=list(map(int,input().split())) B=list(map(int,input().split())) C=[None]*5 for i in range(len(A)): C[i]=A[B[i]-1] print(*C)