def gcd(x, y):
    while x > 0:
        x, y = y % x, x
    return y


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


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