nums = sorted(list(map(int, input().split())), reverse=True)


def gcd(mx, mi):
    if mi == 0:
        return mx
    amari = mx % mi
    return gcd(mi, amari)

print(gcd(nums[0], nums[1]))
 nums = sorted(list(map(int, input().split())), reverse=True) nums sorted(list(map(int, input().split())), reverse=True) sorted list(map(int, input().split())) list map(int, input().split()) map int input().split() ().split () input split reverse=True reverse True def gcd(mx, mi):
    if mi == 0:
        return mx
    amari = mx % mi
    return gcd(mi, amari) gcd if mi == 0:
        return mx
     mi == 0 mi 0 return mx mx amari = mx % mi amari mx % mi mx mi return gcd(mi, amari) gcd(mi, amari) gcd mi amari mx mx mi mi print(gcd(nums[0], nums[1])) print gcd(nums[0], nums[1]) gcd nums[0] nums 0 nums[1] nums 1 nums = sorted(list(map(int, input().split())), reverse=True) sorted(list(map(int, input().split())), reverse=True) nums def gcd(mx, mi):
    if mi == 0:
        return mx
    amari = mx % mi
    return gcd(mi, amari) def gcd(mx, mi):
    if mi == 0:
        return mx
    amari = mx % mi
    return gcd(mi, amari) gcd
nums = sorted(list(map(int, input().split())), reverse=True)


def gcd(mx, mi):
    if mi == 0:
        return mx
    amari = mx % mi
    return gcd(mi, amari)

print(gcd(nums[0], nums[1]))

