{-# OPTIONS_GHC -Wall -Werror #-}

import System.IO

main :: IO ()
main = do
  end <- isEOF
  if end
     then return ()
     else do
      input <- getLine
      let a:b:_ = map read $ words input :: [Int]
          g = show $ gcd a b
          l = show $ lcm a b
      putStrLn $ g ++ " " ++ l
      main