input3 = loop (0,0) []
  where
    loop :: (Int,Int) -> [(Int,Int)] -> IO [(Int,Int)]
    loop tpl list = do
      temp <- getLine
      let [x,y] = map read $ words temp
      if x == 0 && y == 0
        then return list
        else do
        loop (x,y) (list ++ [(x,y)])

exchange3 (x,y)
  | y < x = (show y) ++ " " ++ (show x)
  | otherwise = (show x) ++ " " ++ (show y)

solve3 list = map exchange3 list


main = do
  list <- input3
  mapM_ putStrLn $ solve3 list

