str=input()
a,b=str.split()
a=int(a)
b=int(b)
from math import gcd
print(gcd(a+b,a*b))