gCD :: Int -> Int -> Int
gCD a 0 = a
gCD a b = gcd b (mod a b)

lCM :: Int -> Int -> Int
lCM a b = (a * b) `div` (gCD a b)

chomp :: [a] -> [a]
chomp (x:[]) = []
chomp (x:xr) = x : (chomp xr)

split :: String -> String -> [String]
split _ "" = [""]
split t (s:sr)
  |t == [s] = [] : (split t sr)
  |otherwise = (s : (head (split t sr))) : (tail (split t sr))

main = do
  input <- getContents
  let line = map (\l -> map (\n -> (read n)::Int) l) (map (\n -> split " " n) (split "\n" (chomp input)))
  mapM_ (putStr . (++"\n")) (map (\a -> (show $ gCD (a !! 0) (a !! 1)) ++ (" " ++ (show $ lCM (a !! 0) (a !! 1)))) line)