n = gets.chomp.to_i
b = gets.split(' ').map(&:to_i)

def check n, b
	1.upto(n) do |i|
		return false if b[i - 1] > i
	end
	return true 
end

sorted_b = b.sort

if check n, sorted_b
	sorted_b.each_with_index do |i, idx|
		print i
		print "\n" if idx < sorted_b.size - 1
	end
else
	print -1
end
