import Control.Monad
import Control.Applicative
import Data.Functor
import Data.List
import Data.Char

readInt = readLn :: IO Int
readInts = map read . words <$> getLine :: IO [Int]
cond t f c = if c then t else f

gcdlcm [a, b] = [gcd, lcm] <*> [a] <*> [b]

main = map (map read . words) . lines <$> getContents >>= mapM_ (putStrLn . unwords . map show . gcdlcm)