import qualified Data.List.Split as S

main :: IO()
main = do
    d <- readDatas
    case d of
        ("0","0") -> return ()
        otherwise -> (tuplePrint $ sort d) >> main
    
tuplePrint :: (String,String) -> IO()
tuplePrint (a,b) = putStrLn $ a ++ ' ':b

readDatas :: IO ((String,String))
readDatas = do
    l <- getLine
    let (a:b:_) = S.splitOn " " l
    return $ (a,b)

sort :: (String,String) ->  (String,String) 
sort (a,b)
    | an > bn = (b,a)
    | otherwise = (a,b)
    where
        an = read a :: Integer
        bn = read b :: Integer
