attrs = Array.new
while line = $stdin.gets
    attrs << line.chomp.split.map{|v| v.to_i }
end

for i in 0...(attrs.length) do
  break if attrs[i] == [0, 0]
  a, b = attrs[i].sort
  puts "#{a} #{b}"
end
