nums = []
loop do
    num = gets.split(" ")
    if num[0] == "0" && num[1] == "0"; break; end
    nums << num
end
(0...nums.size).each do |i|
    if nums[i][1].to_i < nums[i][0].to_i
        print nums[i][1], " ", nums[i][0], "\n"
    else
        print nums[i][0], " ", nums[i][1], "\n"
    end
end
