{-
solve :: String -> String
solve s = show (gcd x y) ++ " " ++ show (lcm x y)
    where ns = map read (words s)
          x  = ns !! 0
          y  = ns !! 1
-}

mygcd :: Integer -> Integer -> Integer
mygcd x y
    | r == 0    = y
    | otherwise = mygcd y r
        where r = x `mod` y

mylcm :: Integer -> Integer -> Integer
mylcm x y = x * y `div` mygcd x y

solve :: String -> String
solve s = show (mygcd x y) ++ " " ++ show (mylcm x y)
    where ns = map read (words s)
          x  = ns !! 0
          y  = ns !! 1

main :: IO ()
main = interact (unlines . map solve . lines)