N = gets.to_i A = gets.split.map(&:to_i).reverse puts (0...A[-1]).map { |i| N - (A.bsearch_index { |a| a > i } || N) }.join(' ')