def main(): a=list(map(int,input().split())) b=list(map(int,input().split())) for i in range(5): print(a[b[i]-1],end=" ") print() main()