def gcd(a, b):
    return gcd(b, a % b) if a % b else b

print(gcd(*map(int, input().split()))) def gcd(a, b):
    return gcd(b, a % b) if a % b else b gcd return gcd(b, a % b) if a % b else b gcd(b, a % b) if a % b else b a % b a b gcd(b, a % b) gcd b a % b a b b 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):
    return gcd(b, a % b) if a % b else b def gcd(a, b):
    return gcd(b, a % b) if a % b else b gcd
def gcd(a, b):
    return gcd(b, a % b) if a % b else b

print(gcd(*map(int, input().split())))