a, b = map(int, input().split())

def gcd(a, b):
    if a == b:
        return a
    big = max(a, b)
    small = min(a, b)
    while not big % small == 0:
        big, small = small, big%small
    return small
    
print(gcd(a, b))
 a, b = map(int, input().split()) a map(int, input().split()) map int input().split() ().split () input split b def gcd(a, b):
    if a == b:
        return a
    big = max(a, b)
    small = min(a, b)
    while not big % small == 0:
        big, small = small, big%small
    return small
     gcd if a == b:
        return a
     a == b a b return a a big = max(a, b) big max(a, b) max a b small = min(a, b) small min(a, b) min a b while not big % small == 0:
        big, small = small, big%small
     not big % small == 0 big % small == 0 big % small big small 0 big, small = small, big%small big small small big%small big small return small small a a b b print(gcd(a, b)) print gcd(a, b) gcd a b b = map(int, input().split()) map(int, input().split()) b def gcd(a, b):
    if a == b:
        return a
    big = max(a, b)
    small = min(a, b)
    while not big % small == 0:
        big, small = small, big%small
    return small
     def gcd(a, b):
    if a == b:
        return a
    big = max(a, b)
    small = min(a, b)
    while not big % small == 0:
        big, small = small, big%small
    return small
     gcd a, b = map(int, input().split()) map(int, input().split()) a
a, b = map(int, input().split())

def gcd(a, b):
    if a == b:
        return a
    big = max(a, b)
    small = min(a, b)
    while not big % small == 0:
        big, small = small, big%small
    return small
    
print(gcd(a, b))

