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