N = gets.to_i
bs = gets.strip.split(/ /).collect{|x| x.to_i}

process = [:dummy] + [nil] * N

def put(process, n)
	j = 1
	i = 1
	while j <= N
		if process[j]
		else
			if i == n
				process[j] = n
				return j
			end
			i += 1
		end
		j += 1
	end
	nil
end

N.times{|i|
	b = bs.pop
	
	unless put(process, b)
		puts "-1"
		exit
	end
}

(1..N).each{|i|
	puts process[i]
}
