gets
inputs = gets.split(' ').map(&:to_i)
results = inputs

inputs.each_with_index do |input, i|
  k = 0
  results.each_with_index do |result, j|
    k = j
    break if input == result || input <= result
  end

  tmp = results[i]
  results.delete_at(i)
  results.insert(k, tmp)

  puts results.join(' ')
end
