n = gets.to_i
b = gets.chomp.split(' ').map(&:to_i).sort.reverse
a = []
result = 0
(1..n).each do |i|
  x = b.index {|n| n == i}
  if x.nil?
    result = -1
    break
  end
  a << b[x]
  b.delete_at!(x)
end
if result == -1
  puts '-1'
else
  a.each do |x|
    puts x
  end
end