num = int(eval(input()))

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



number = list(range(num))

data = dict(list(zip(number, li)))

data_sorted = sorted(list(data.items()), key = lambda x:x[1])

data_key = [str(i[0] + 1) for i in data_sorted]

print((" ".join(data_key)))
x = int(eval(input()))

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



li = list("A" * x)



for index, num in enumerate(num_list):

	li[num-1] = str(index+1)



print((" ".join(li)))
num = int(eval(input()))
li = list(map(int, input().split()))
number = list(range(num))
data = dict(list(zip(number, li)))
data_sorted = sorted(list(data.items()), key=lambda x: x[1])
data_key = [str(i[0] + 1) for i in data_sorted]
print((" ".join(data_key)))

x = int(eval(input()))
num_list = list(map(int, input().split()))
li = list("A" * x)
for index, num in enumerate(num_list):
    li[num - 1] = str(index + 1)
print((" ".join(li)))

-num = int(eval(input())) -li = list(map(int, input().split())) -number = list(range(num)) -data = dict(list(zip(number, li))) -data_sorted = sorted(list(data.items()), key=lambda x: x[1]) -data_key = [str(i[0] + 1) for i in data_sorted] -print((" ".join(data_key))) +x = int(eval(input())) +num_list = list(map(int, input().split())) +li = list("A" * x) +for index, num in enumerate(num_list): +    li[num - 1] = str(index + 1) +print((" ".join(li)))