import Control.Applicative
import Control.Monad

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