x, y = input().split()

x = int(x)

y = int(y)

r = 1

while r > 0:

    if x >= y:

        r = x % y

    else:

        r = y % x



    if r != 0:

        x = y

        y = r

    else:

        print(y)
def gcd(x, y):

    if y == 0:

        print(x)

        return x

    return gcd(y, x%y)



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

if y > x:

    t = y

    y = x

    x = t

gcd(x, y)
x, y = input().split()
x = int(x)
y = int(y)
r = 1
while r > 0:
    if x >= y:
        r = x % y
    else:
        r = y % x
    if r != 0:
        x = y
        y = r
    else:
        print(y)

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


x, y = list(map(int, input().split()))
if y > x:
    t = y
    y = x
    x = t
gcd(x, y)

-x, y = input().split() -x = int(x) -y = int(y) -r = 1 -while r > 0: -    if x >= y: -        r = x % y -    else: -        r = y % x -    if r != 0: -        x = y -        y = r -    else: -        print(y) +def gcd(x, y): +    if y == 0: +        print(x) +        return x +    return gcd(y, x % y) + + +x, y = list(map(int, input().split())) +if y > x: +    t = y +    y = x +    x = t +gcd(x, y)