eval(input())

li=list(map(int,input().split()))

enu_li=[[i,value] for i,value in enumerate(li,1)]



enu_li=sorted(enu_li,key=lambda x:x[1])



result=[str(value[0]) for value in enu_li]



print((' '.join(result)))
n=int(eval(input()))

li=list(map(int,input().split()))



mod_li=[[i,num] for i,num in enumerate(li,1)]

result_li=sorted(mod_li, key=lambda x: x[1])



result=[str(num[0]) for num in result_li]

print((" ".join(result)))
eval(input())
li = list(map(int, input().split()))
enu_li = [[i, value] for i, value in enumerate(li, 1)]
enu_li = sorted(enu_li, key=lambda x: x[1])
result = [str(value[0]) for value in enu_li]
print((" ".join(result)))

n = int(eval(input()))
li = list(map(int, input().split()))
mod_li = [[i, num] for i, num in enumerate(li, 1)]
result_li = sorted(mod_li, key=lambda x: x[1])
result = [str(num[0]) for num in result_li]
print((" ".join(result)))

-eval(input()) +n = int(eval(input())) -enu_li = [[i, value] for i, value in enumerate(li, 1)] -enu_li = sorted(enu_li, key=lambda x: x[1]) -result = [str(value[0]) for value in enu_li] +mod_li = [[i, num] for i, num in enumerate(li, 1)] +result_li = sorted(mod_li, key=lambda x: x[1]) +result = [str(num[0]) for num in result_li]