import Data.List

main :: IO ()
main  = getContents
    >>= return . map (map (read :: String -> Int)) . map words . lines
    >>= return . takeWhile (/= [0,0])
    >>= return . map sort
    >>= return . map (\ [x,y] -> show x ++ " " ++ show y)
    >>= mapM_ putStrLn