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

# p N
# p B

Res = []
Erased = Array.new(N, false)  # erased flag

def solve
  0.upto(N-1).each do
    last_k = -1
    last_i = -1

    k = 0  # k: the index without erased one
    0.upto(N-1).each do |i|  # i: the index with erased one
      next if (Erased[i]) # skip erased one
      
      if (B[i] == k + 1)
        last_k = k
        last_i = i
      end
      
      k += 1
    end
    
    # Now, last_k is the largetst k
    if last_k == -1  # No one found
      p -1
      return
    end
    
    Erased[last_i] = true
    Res << last_k
  end
  
  Res.reverse.each do |e|
    p e + 1  # 1-indexed
  end
end

solve