f i = do
  ln_i <- getLine
  let x:y:[] = map (read::String->Int) (words ln_i)
  if (x == 0 && y == 0)
    then return () else do
      putStrLn $ show (min x y) ++ " " ++ show (max x y)
      f $ i+1
main = f 1
