local n=io.read("n")
local b={}
for i=1,n do
    b[i]=io.read("n")
end

local a={}
for i=1,n do
    for j=#b,1,-1 do
        if b[j]==j then
            table.remove(b,j)
            a[i]=j
            break
        end
    end
end

if #a==n then
    for i=n,1,-1 do
        print(a[i])
    end
else
    print(-1)
end