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