a,b=int(input().split()) d=a*b dd=a+b; print(math.gcd(d,dd));