def Euclid(a, b):
a, b = max(a, b) % min(a, b), min(a, b)
if a == 0:
return b
return Euclid(a, b)
print(Euclid(*map(int, input().split(
def Euclid(a, b):
a, b = max(a, b) % min(a, b), min(a, b)
if a == 0:
return b
return Euclid(a, b)
print(Euclid(*map(int, input().split(