# coding: utf-8
# Here your code !
def mcg(a,b):
    if a==b:
        return a
    else:
        
        while a%b !=0:
            x = a%b
            a = b
            b = x
        return x

num =sorted(list(map(int,input().split(" "))))
print(mcg(num[0],num[1])) def mcg(a,b):
    if a==b:
        return a
    else:
        
        while a%b !=0:
            x = a%b
            a = b
            b = x
        return x mcg if a==b:
        return a
    else:
        
        while a%b !=0:
            x = a%b
            a = b
            b = x
        return x a==b a b return a a while a%b !=0:
            x = a%b
            a = b
            b = x
         a%b !=0 a%b a b 0 x = a%b x a%b a b a = b a b b = x b x return x x a a b b num =sorted(list(map(int,input().split(" ")))) num sorted(list(map(int,input().split(" ")))) sorted list(map(int,input().split(" "))) list map(int,input().split(" ")) map int input().split(" ") ().split () input split " " print(mcg(num[0],num[1])) print mcg(num[0],num[1]) mcg num[0] num 0 num[1] num 1 def mcg(a,b):
    if a==b:
        return a
    else:
        
        while a%b !=0:
            x = a%b
            a = b
            b = x
        return x def mcg(a,b):
    if a==b:
        return a
    else:
        
        while a%b !=0:
            x = a%b
            a = b
            b = x
        return x mcg num =sorted(list(map(int,input().split(" ")))) sorted(list(map(int,input().split(" ")))) num
# coding: utf-8
# Here your code !
def mcg(a,b):
    if a==b:
        return a
    else:
        
        while a%b !=0:
            x = a%b
            a = b
            b = x
        return x

num =sorted(list(map(int,input().split(" "))))
print(mcg(num[0],num[1]))