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