main = getLine >>= print . solve . map read . words where solve [a, b] = gcd (a + b) (a * b)