def gcd(b, s):
    mod = b % s
    if mod != 0:
        return gcd(s, mod)
        
    else:
        return s

x, y = map(int, input().split())
b = max(x, y)
s = min(x, y)
a = gcd(b, s)
print(a) def gcd(b, s):
    mod = b % s
    if mod != 0:
        return gcd(s, mod)
        
    else:
        return s gcd mod = b % s mod b % s b s if mod != 0:
        return gcd(s, mod)
        
    else:
        return s mod != 0 mod 0 return gcd(s, mod) gcd(s, mod) gcd s mod return s s b b s s x, y = map(int, input().split()) x map(int, input().split()) map int input().split() ().split () input split y b = max(x, y) b max(x, y) max x y s = min(x, y) s min(x, y) min x y a = gcd(b, s) a gcd(b, s) gcd b s print(a) print a def gcd(b, s):
    mod = b % s
    if mod != 0:
        return gcd(s, mod)
        
    else:
        return s def gcd(b, s):
    mod = b % s
    if mod != 0:
        return gcd(s, mod)
        
    else:
        return s gcd y = map(int, input().split()) map(int, input().split()) y s = min(x, y) min(x, y) s x, y = map(int, input().split()) map(int, input().split()) x b = max(x, y) max(x, y) b a = gcd(b, s) gcd(b, s) a
def gcd(b, s):
    mod = b % s
    if mod != 0:
        return gcd(s, mod)
        
    else:
        return s

x, y = map(int, input().split())
b = max(x, y)
s = min(x, y)
a = gcd(b, s)
print(a)