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