4MLE1AC4MLE 1AC4MLE1AC
a = input() s = [int(i) for i in input().split()] d = [int(i) for i in input().split()] for i in d: print(s[i - 1])