n = gets.to_i
b = gets.split.map{|e|e.to_i}
a = Array.new(n , 0)
r = true
n.times do |i|
    g = b[-i-1] - n + i
    if g > 0 || g < -n
        r = false
    else
        count = 0
        n.times do |j|
            if a[-j-1] == 0
                count -= 1
            end
            if g == count+1
                a[-j-1] = b[-i-1]
                break
            end
        end
    end
    if !r
        break
    end
end
if !r
    puts -1
else
    puts a.*("\n")
end
            

