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