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