def gcd(x, y):
    if x < y:
        tmp = x
        x = y
        y = tmp
    while y > 0:
        r = x % y
        x = y
        y = r

    return print(x)

x_y = input()
tmp = list(map(int, x_y.split()))
x = tmp[0]
y = tmp[1]
gcd(x, y) def gcd(x, y):
    if x < y:
        tmp = x
        x = y
        y = tmp
    while y > 0:
        r = x % y
        x = y
        y = r

    return print(x) gcd if x < y:
        tmp = x
        x = y
        y = tmp
     x < y x y tmp = x tmp x x = y x y y = tmp y tmp while y > 0:
        r = x % y
        x = y
        y = r

     y > 0 y 0 r = x % y r x % y x y x = y x y y = r y r return print(x) print(x) print x x x y y x_y = input() x_y input() input tmp = list(map(int, x_y.split())) tmp list(map(int, x_y.split())) list map(int, x_y.split()) map int x_y.split() x_y.split x_y split x = tmp[0] x tmp[0] tmp 0 y = tmp[1] y tmp[1] tmp 1 gcd(x, y) gcd x y tmp = list(map(int, x_y.split())) list(map(int, x_y.split())) tmp x = tmp[0] tmp[0] x def gcd(x, y):
    if x < y:
        tmp = x
        x = y
        y = tmp
    while y > 0:
        r = x % y
        x = y
        y = r

    return print(x) def gcd(x, y):
    if x < y:
        tmp = x
        x = y
        y = tmp
    while y > 0:
        r = x % y
        x = y
        y = r

    return print(x) gcd x_y = input() input() x_y y = tmp[1] tmp[1] y
def gcd(x, y):
    if x < y:
        tmp = x
        x = y
        y = tmp
    while y > 0:
        r = x % y
        x = y
        y = r

    return print(x)

x_y = input()
tmp = list(map(int, x_y.split()))
x = tmp[0]
y = tmp[1]
gcd(x, y)
