def gcd(x, y):
    if y == 0:
        return print(x)
    return gcd(y, x % y)

x, y = map(int, input().split())
gcd(x, y) def gcd(x, y):
    if y == 0:
        return print(x)
    return gcd(y, x % y) gcd if y == 0:
        return print(x)
     y == 0 y 0 return print(x) print(x) print x return gcd(y, x % y) gcd(y, x % y) gcd y x % y x y x x y y x, y = map(int, input().split()) x map(int, input().split()) map int input().split() ().split () input split y gcd(x, y) gcd x y y = map(int, input().split()) map(int, input().split()) y x, y = map(int, input().split()) map(int, input().split()) x def gcd(x, y):
    if y == 0:
        return print(x)
    return gcd(y, x % y) def gcd(x, y):
    if y == 0:
        return print(x)
    return gcd(y, x % y) gcd
def gcd(x, y):
    if y == 0:
        return print(x)
    return gcd(y, x % y)

x, y = map(int, input().split())
gcd(x, y)
