import Data.Functor

main = do
  s <- getRows <$> getContents
  mapM_ putStrLn $ map (\[x,y] -> unwords [show (gcd x y), show (lcm x y)]) s

getRows s = map ((map (read :: (String -> Int))) . words) $ lines s