MODE = "stdio"

line = Array.new

if(defined? MODE)
  line = STDIN.read.split("\n")
else
  tmp = "\
  3 2
  2 2
  5 3
  0 0
  ".split("\n")
  tmp.each{|s|
    line << s.strip
  }
end


list = Array.new

list = line.map{|s| s.split(" ")}
  
list.each do|l|
  l.map!(&:to_i)
  l.sort!
end

list.each do |a,b|
  puts "#{a} #{b}" if !(a==0 && b==0)
end