from math import gcd
A, B = map(int, input().split())
g = gcd(A, B)
a = A // g
b = B // g
ans = g * gcd(a + b, g)
print(ans)

ad293ed8dc445d362495bc67aa4d5f6f433f3fd5
<mask token>

<mask token>
print(ans)

<mask token>
A, B = map(int, input().split())
g = gcd(A, B)
a = A // g
b = B // g
ans = g * gcd(a + b, g)
print(ans)

from math import gcd
A, B = map(int, input().split())
g = gcd(A, B)
a = A // g
b = B // g
ans = g * gcd(a + b, g)
print(ans)
