def counting_sort(array)
  count = Array.new(array.length, 0)
  count_sum = Array.new(array.length, 0)
  sorted = Array.new(array.length, 0)
  array.each do |value|
    count[value] += 1
  end

  count.each_with_index do |value, index|
    if index.zero?
      count_sum[index] = value
    end
    count_sum[index] = count_sum[index - 1] + value
  end

  array.reverse_each do |value|
    index = count_sum[value] -= 1
    sorted[index] = value
  end
  sorted
end

gets
input = gets.split(' ').map(&:to_i)
puts counting_sort(input).join ' '
