import Control.Applicative
import Control.Monad
import Data.List
rInt s = read s :: Int

main = do
   ls <- map (map rInt . words) . lines <$> getContents
   mapM putStrLn $ map (unwords . map show . sort) $ takeWhile (\c -> c /= [0, 0]) ls