N = gets.chomp.to_i
b = gets.chomp.split.map(&:to_i)

ans = []

N.times do |i|
  tmp = 1000
  b.length.times do |j|
    if b[j] == j + 1
      tmp = j + 1
    end
  end

  if tmp == 1000
    puts -1
    exit
  end

  b.delete_at(tmp-1)
  ans << tmp
end

ans.reverse.each do |num|
  p num
end
