import Data.List
import Data.Char
import Data.Functor
import Text.Printf
import System.IO
import qualified Data.ByteString.Char8 as B

getInts :: IO[Integer]
getInts = unfoldr (B.readInteger . B.dropWhile isSpace) <$> B.getLine

main = do
  end <- isEOF
  if end then return ()
  else do
    (a:b:_) <- getInts
    putStrLn $ printf "%ld %ld" (gcd a b) (lcm a b)
    main