import System.IO

main = do
  end <- isEOF
  if end then return ()
  else
    do
      line <- getLine
      let [a,b] = map read . words $ line
          x = gcd a b
          y = lcm a b
          in putStrLn $ show x ++ " " ++ show y
      main