array = []

while true do
  num = gets.chomp.split(" ").map(&:to_i)
  if num[0] == 0 && num[1] == 0
    break
  else
    array << num
  end
end

array.each do |i|
  sorted =  i.sort
  print sorted[0]
  print " "
  print sorted[1]
  puts ""
end
