#yuki_442

def gcd(a, b):
 while b:
  a, b = b, a % b
 return a

a,b=map(int,raw_input().split())
s=a+b
p=a*b

print gcd(s,p)