import Data.List

allswap :: [[Integer]] -> [String]
allswap ([x,y]:ps)
    | x == 0 && y == 0 = []
    | otherwise        = ((unwords . map show . sort) [x, y]) : (allswap ps)

main = do
    givenstr <- getContents
    putStr ((unlines . allswap . map (map (read :: String -> Integer)) . map words . lines) givenstr)