def gcd(a, b):
if a == 0:
return b
return gcd(b % a, a)
a = int(input())
b = int(input())
print(gcd(a, b))
1) 1234
2)1111
3)171
4)3421
5)17
def gcd(a, b):
if a == 0:
return b
return gcd(b % a, a)
a = int(input())
b = int(input())
print(gcd(a, b))
1) 1234
2)1111
3)171
4)3421
5)17