<filename>agc032_a.py<gh_stars>0
input()
b=list(map(int,input().split()))
q=[]
for bi in b:
    i=bi-1
    if len(q) < i:
        print(-1)
        break
    q.insert(i,bi)
else:
    for qi in q:
        print(qi)
