import Text.Printf
body :: Int -> IO ()
body i = do
         ln <- getLine
         let [x,y] = map read $ words ln :: [Int]
         if (x == 0 && y == 0) then return () else do
           printf "%d %d\n" (if (x < y) then x else y) (if (x < y) then y else x)
           body (i + 1)

main = body 1