import qualified Data.List.Split as S

main :: IO()
main = do
    d <- readDatas
    case d of
        ("0","0") -> return ()
        otherwise -> reversePrint d >> main
    
reversePrint :: (String,String) -> IO()
reversePrint (a,b) = putStrLn $ b ++ ' ':a

readDatas :: IO ((String,String))
readDatas = do
    l <- getLine
    let (a:b:_) = S.splitOn " " l
    return $ (a,b)

reverse :: (String,String) ->  (String,String) 
reverse (a,b) = (b,a)
