# calculating gcd of two numbers in python

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

a,b=map(int,input().split())
print(gcd(a,b))

8a333a216fcc6c4c32cafd942586e9306fb4ea25
<mask token>

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


<mask token>

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


<mask token>
print(gcd(a, b))

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


a, b = map(int, input().split())
print(gcd(a, b))

# calculating gcd of two numbers in python

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

a,b=map(int,input().split())
print(gcd(a,b))
