import Data.Function
import System.IO
import Control.Monad
import Control.Applicative
main = do
     fix $ \loop -> do
         eof <- isEOF
         unless eof $ do
           a:b:_ <- map read . words <$> getLine :: IO [Int]
           putStrLn $ show (gcd a b) ++ " " ++ show (lcm a b)
           loop