import sys sys.setrecursionlimit(5*10**5) input = sys.stdin.readline from collections import defaultdict, deque, Counter from heapq import heappop, heappush from bisect import bisect_left, bisect_right from math import gcd a = list(map(int,input().split())) b = list(map(int,input().split())) aa = dict() bb = dict() ans = [0]*(5) for i in range(5): ans[i] = a[b[i]-1] print(*ans)