def gcd(a, b): if a < b: a, b = b, a c = a % b return b if c == 0 else gcd(b, c) print(gcd(*((lambda x: [x[0] + x[1], x[0] * x[1]])(list(map(int, input().split()))))))