n=int(eval(input()))

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

a=[0]*(n+1)

a[0]=0

for i in b:a.insert(int(i)-1,i)

if sum(a[:n])==sum(b):

    for i in range(n):

        print((a[i]))

else:print((-1))
n=int(eval(input()))

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

a=[0]

for b in B:a.insert(b-1,b)

if sum(a[:n])==sum(B):

    for i in range(n):print((a[i]))

else:print((-1))
n = int(eval(input()))
b = list(map(int, input().split()))
a = [0] * (n + 1)
a[0] = 0
for i in b:
    a.insert(int(i) - 1, i)
if sum(a[:n]) == sum(b):
    for i in range(n):
        print((a[i]))
else:
    print((-1))

n = int(eval(input()))
B = list(map(int, input().split()))
a = [0]
for b in B:
    a.insert(b - 1, b)
if sum(a[:n]) == sum(B):
    for i in range(n):
        print((a[i]))
else:
    print((-1))

-b = list(map(int, input().split())) -a = [0] * (n + 1) -a[0] = 0 -for i in b: -    a.insert(int(i) - 1, i) -if sum(a[:n]) == sum(b): +B = list(map(int, input().split())) +a = [0] +for b in B: +    a.insert(b - 1, b) +if sum(a[:n]) == sum(B):