size = gets.chomp.to_i
input_values = []

input_value_array = gets.chomp.split
for i in 0..size-1
  input_value = input_value_array[i].to_i
  input_values.push(input_value)
end

for n in 0..(size-1) do
    min = input_values[n]
    min_position = n
    for m in (n+1)..(size-1) do
      if input_values[m] < min
        min = input_values[m]
        min_position = m
        p input_values.join(' ')
      end
    end
    tmp = input_values[n]
    input_values[n] = min
    input_values[min_position] = tmp
  end
p input_values.join(' ')