--AOJ Swapping Two Numbers

rlength :: Int -> Int -> Int
rlength a b = 2 * (a + b)

rInt :: String -> Int
rInt str = read str :: Int

swap :: Int -> Int -> String
swap a b 
  |a <= b    = show a ++ " " ++ show b
  |otherwise = show b ++ " " ++ show a         

main :: IO ()
main = do
  input <- getLine
  let doubleInt = map rInt $ words input
  let a = head doubleInt
      b = last doubleInt
  if a == 0 && b == 0
     then return ()
     else do putStrLn $ swap a b
     	     main