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