N = gets.to_i
b = gets.split.map(&:to_i)
ans = []

N.times do |i|
  max = N
  t = N-1-i
  (N-i).times do |j|
    c = j+1 - b[j]
    if c < 0
      p -1
      exit
    elsif max >= c
      max = c
      t = j
    end
  end
  #p diff
  ans << b[t]
  b.delete_at(t)
end

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