n = gets.to_i
bs = gets.chomp.split(' ').map(&:to_i)
xs = []
result = 0
if bs.length >= n
  print -1
else
  bs.sort.each_with_index do |b, i|
    if (i+1) > b
      print -1
      result = -1
      break
    else
      xs << b
    end
  end
end
if result == -1
  print -1
else
  xs.each do |x|
    print x
end