def gcd(a, b):
    if a < b:
        a, b = b, a
    while b != 0:
        a, b = b, a % b
    return a
print(gcd(*map(int, input().split()))) def gcd(a, b):
    if a < b:
        a, b = b, a
    while b != 0:
        a, b = b, a % b
    return a gcd if a < b:
        a, b = b, a
     a < b a b a, b = b, a a b b a while b != 0:
        a, b = b, a % b
     b != 0 b 0 a, b = b, a % b a b b a % b a b return a a a a b b print(gcd(*map(int, input().split()))) print gcd(*map(int, input().split())) gcd *map(int, input().split()) map(int, input().split()) map int input().split() ().split () input split def gcd(a, b):
    if a < b:
        a, b = b, a
    while b != 0:
        a, b = b, a % b
    return a def gcd(a, b):
    if a < b:
        a, b = b, a
    while b != 0:
        a, b = b, a % b
    return a gcd
def gcd(a, b):
    if a < b:
        a, b = b, a
    while b != 0:
        a, b = b, a % b
    return a
print(gcd(*map(int, input().split())))
