x, y = [int(i) for i in input().split()]

if x < y:
    a = x
    x = y
    y = a

def kouyakusu(x,y):
    yakusu = x % y
    if yakusu == 0:
        print(y)
        return y
    else:
        kouyakusu(y,yakusu)

max_kouyakusu = kouyakusu(x,y) int(i) for i in input().split() for i in input().split() i input().split() ().split () input split for i in input().split() int(i) int i x, y = [int(i) for i in input().split()] x [int(i) for i in input().split()] y if x < y:
    a = x
    x = y
    y = a x < y x y a = x a x x = y x y y = a y a def kouyakusu(x,y):
    yakusu = x % y
    if yakusu == 0:
        print(y)
        return y
    else:
        kouyakusu(y,yakusu) kouyakusu yakusu = x % y yakusu x % y x y if yakusu == 0:
        print(y)
        return y
    else:
        kouyakusu(y,yakusu) yakusu == 0 yakusu 0 print(y) print y return y y kouyakusu(y,yakusu) kouyakusu y yakusu x x y y max_kouyakusu = kouyakusu(x,y) max_kouyakusu kouyakusu(x,y) kouyakusu x y x = y y x a = x x a def kouyakusu(x,y):
    yakusu = x % y
    if yakusu == 0:
        print(y)
        return y
    else:
        kouyakusu(y,yakusu) def kouyakusu(x,y):
    yakusu = x % y
    if yakusu == 0:
        print(y)
        return y
    else:
        kouyakusu(y,yakusu) kouyakusu max_kouyakusu = kouyakusu(x,y) kouyakusu(x,y) max_kouyakusu y = [int(i) for i in input().split()] [int(i) for i in input().split()] y y = a a y x, y = [int(i) for i in input().split()] [int(i) for i in input().split()] x
x, y = [int(i) for i in input().split()]

if x < y:
    a = x
    x = y
    y = a

def kouyakusu(x,y):
    yakusu = x % y
    if yakusu == 0:
        print(y)
        return y
    else:
        kouyakusu(y,yakusu)

max_kouyakusu = kouyakusu(x,y)