n = gets.chomp.to_i
ary = gets.chomp.split.map(&:to_i)

ans = ary.join

flag = false
tmp_ary = []
ary.each_with_index do |i, idx|
    if idx+1-i < 0
        flag = true
        break
    end
    tmp_ary << idx+1-i
end
if flag
    puts -1
else
    ans_ary = []
    ary.each_with_index do |i,idx|
        ans_ary.insert(-1*tmp_ary[idx]-1, i)
    end
    puts ans_ary
end


