n, *a = list(map(int, open(0).read().split()))

a.sort()

ans = 1e10

for i in range(1, n):

    x, y = a[0], a[i]

    while y%x:

        y -= y//x*x

        x, y = y, x

    ans = min(ans, x)

print(ans)
def gcd(a, b):

    if(a==0): return b

    if a<b: a,b=b,a

    while b: a,b=b,a%b

    return a



n, *a = list(map(int, open(0).read().split()))

g = 0

for i in a: g = gcd(g, i)

print(g)
n, *a = list(map(int, open(0).read().split()))
a.sort()
ans = 1e10
for i in range(1, n):
    x, y = a[0], a[i]
    while y % x:
        y -= y // x * x
        x, y = y, x
    ans = min(ans, x)
print(ans)

def gcd(a, b):
    if a == 0:
        return b
    if a < b:
        a, b = b, a
    while b:
        a, b = b, a % b
    return a


n, *a = list(map(int, open(0).read().split()))
g = 0
for i in a:
    g = gcd(g, i)
print(g)

+def gcd(a, b): +    if a == 0: +        return b +    if a < b: +        a, b = b, a +    while b: +        a, b = b, a % b +    return a + + -a.sort() -ans = 1e10 -for i in range(1, n): -    x, y = a[0], a[i] -    while y % x: -        y -= y // x * x -        x, y = y, x -    ans = min(ans, x) -print(ans) +g = 0 +for i in a: +    g = gcd(g, i) +print(g)