arr = []
i=0
loop do
  a, b = gets.chomp.split(' ').map(&:to_i)
  if a != 0
    if a < b
      arr.push([a, b])
    else
      arr.push([b, a])
    end
  else
    arr.each {|i| puts i[0].to_s+' '+i[1].to_s}
    break
  end
  i+=1
end