import Data.List
import Control.Applicative
import Control.Monad
main = solve

solve :: IO ()
solve = do
    n <- fmap (read :: String -> Int) . words <$> getLine
    printResult n

printResult :: [Int] -> IO ()
printResult n
    | x == 0 && y == 0 = return ()
    | otherwise = do
        putStrLn $ show (min x y) ++ " " ++ show (max x y)
        solve
    where x = n !! 0
          y = n !! 1