main = do
  s <- getContents
  let g x = read x :: Int
  let f = (\[a,b] -> if g a > g b then putStrLn $ b ++ " " ++ a else putStrLn $ a ++ " \
" ++ b) . words
  mapM_ f . takeWhile(/="0 0") . lines $ s