import Control.Applicative import Control.Monad main = print . solve =<< fmap read . words <$> getLine solve [a,b] = gcd (a+b) (a*b)