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