array = []
loop do
  line = gets.split.map {|s| s.to_i}
  x = line[0]
  y = line[1]
  if x == 0 && y == 0 then
    break
  end
  tmp = []
  if x > y then
    tmp << y
    tmp << x
  else 
    tmp << x
    tmp << y
  end
  array << tmp
end

array.each do |line|
  puts "#{line[0]} #{line[1]}"
end