def selection_sort(n, as)
  i = 0
  while i < n do
    min = as[i]
    min_index = i
    j = i + 1
    while j < n do
      if min > as[j]
        min = as[j]
        min_index = j
      end
      j = j + 1
    end
    if min_index > i
      a = as[min_index]
      as[min_index] = as[i]
      as[i] = a
    end
    i = i + 1
  end
  puts as.join(' ')
end

n = STDIN.gets.to_i
as = STDIN.gets.split(' ').map {|x| x.to_i }
selection_sort(n, as)

