module Main where

import Control.Applicative
import Control.Monad
import Data.List
import Prelude             hiding (gcd, lcm)
import Text.Printf         (printf)

main :: IO ()
main = do
    pairs <- map (sort . map read . words) . lines <$> getContents
    forM_ pairs $ \[a,b] -> printf "%d %d\n" (gcd b a) (lcm a b)

gcd :: Int -> Int -> Int
gcd m 0 = m
gcd m n = gcd n (m `mod` n)

lcm :: Int -> Int -> Int
lcm 0 _ = 0
lcm _ 0 = 0
lcm m n = abs $ (n `quot` gcd m n) * m