n = gets.to_i
arr = gets.split.map(&:to_i)
c = []
arr.each { |a| c[a] = c[a].to_i + 1 }
c.each.with_index(0) { |ct, idx| next if idx == 0; c[idx] = c[idx].to_i + c[idx-1].to_i }
result = []
arr.reverse.each do |a|
  result[c[a]-1] = a
  c[a] -= 1
end
puts result.compact.map(&:to_s).join(' ')
