import Control.Applicative
import Control.Monad
import Data.List
import Data.Ratio
import Text.Printf
import System.IO

main :: IO ()
main = do
  e <- isEOF 
  when (not e) $ do
    [a,b] <- map read . words <$> getLine :: IO [Int]
    printf "%d %d\n" (gcd a b) (lcm a b)
    main

