import Control.Applicative
main = do
  ss <- map (map read . words) . lines <$> getContents
  mapM_ putStrLn $ map solve ss
solve :: [Int] -> String
solve [a, b] = unwords $ map show [a `gcd` b, (a * b) `div` (a `gcd` b)]