A = list(map(int, input().split()))
B = list(map(int, input().split()))

for i in range(5):
    print(f"{A[B[i] - 1]}", end = " ")