import           Control.Applicative
import           Control.Monad
import           Text.Printf         (printf)

swap :: [Int] -> [Int]
swap c@[a, b]
    | a > b = [b, a]
    | otherwise = c

main :: IO ()
main = do
    xss <- fmap (fmap read . words) . lines <$> getContents :: IO [[Int]]
    forM_ (takeWhile (/= [0, 0]) xss) $ \xs -> do
        let [a, b] = swap xs
        printf "%d %d\n" a b

