import System.IO

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