import Control.Applicative
import Control.Monad

main :: IO()
main = do
  ls <- map (map read . words) . lines <$> getContents
  forM_ ls $ \[a, b] -> do
    putStrLn $ unwords $ map show [gcd a b, lcm a b]
