decompose :: String -> [Int]
decompose s = map read $ words s

solve :: [Int] -> String
solve [x, y]
    | x < y     = show x ++ " " ++ show y
    | otherwise = show y ++ " " ++ show x

main :: IO ()
main = interact (unlines . map solve . takeWhile (\[x, y] -> x /= 0 && y /= 0) . map decompose . lines)