import           Control.Applicative
import qualified Control.Monad       as Monad
import           Data.List

main :: IO ()
main = loop

loop :: IO ()
loop = do
    x : y : _ <- (map read . words) <$> getLine
    Monad.when (x /= 0 && y /= 0) $ do
        putStrLn $ if x > y
            then show y ++ " " ++ show x
            else show x ++ " " ++ show y
        loop