def gcd(a, b):
    if b == 0: return a
    return gcd(b, a % b)


alllist = list(map(int, input().split()))
alllist = sorted(alllist, reverse=True)


result = gcd(alllist[0], alllist[1])
print(result)
 def gcd(a, b):
    if b == 0: return a
    return gcd(b, a % b) gcd if b == 0: return a
     b == 0 b 0 return gcd(b, a % b) gcd(b, a % b) gcd b a % b a b a a b b alllist = list(map(int, input().split())) alllist list(map(int, input().split())) list map(int, input().split()) map int input().split() ().split () input split alllist = sorted(alllist, reverse=True) alllist sorted(alllist, reverse=True) sorted alllist reverse=True reverse True result = gcd(alllist[0], alllist[1]) result gcd(alllist[0], alllist[1]) gcd alllist[0] alllist 0 alllist[1] alllist 1 print(result) print result result = gcd(alllist[0], alllist[1]) gcd(alllist[0], alllist[1]) result alllist = list(map(int, input().split())) list(map(int, input().split())) alllist def gcd(a, b):
    if b == 0: return a
    return gcd(b, a % b) def gcd(a, b):
    if b == 0: return a
    return gcd(b, a % b) gcd alllist = sorted(alllist, reverse=True) sorted(alllist, reverse=True) alllist
def gcd(a, b):
    if b == 0: return a
    return gcd(b, a % b)


alllist = list(map(int, input().split()))
alllist = sorted(alllist, reverse=True)


result = gcd(alllist[0], alllist[1])
print(result)

