f :: [[Int]] -> IO()
f ([0,0]:_) = return ()
f ([x,y]:r) = do 
    putStrLn $ if(x < y) then (show x) ++ " " ++ (show y) else (show y) ++ " " ++ (show x) 
    f r

main = getContents >>= f . map (map read) . (map words) . lines
