import Control.Applicative

main :: IO ()
main = do
    nss <- map (map read . words) . lines <$> getContents
    mapM_ putStrLn $ map (unwords . (map show)) $ solve nss

solve :: [[Integer]] -> [[Integer]]
solve [] = []
solve (n:ns) = (solve'):(solve ns)
    where
        a = maximum n
        b = minimum n
        g = gcd a b
        l = (fromIntegral $ a * b) `div` (fromIntegral g)
        solve' = [g, l]