def gcd(x, y):

    if y == 0: return x

    return gcd(y, x % y)





N = int(eval(input()))

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



g = a[0]

for aa in a[1:]:

    g = gcd(g, aa)

print(g)

from functools import reduce





def gcd(a, b):

    if b == 0: return a

    return gcd(b, a % b)





n = int(eval(input()))

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



print((reduce(gcd, a)))

def gcd(x, y):
    if y == 0:
        return x
    return gcd(y, x % y)


N = int(eval(input()))
a = list(map(int, input().split()))
g = a[0]
for aa in a[1:]:
    g = gcd(g, aa)
print(g)

from functools import reduce


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


n = int(eval(input()))
a = list(map(int, input().split()))
print((reduce(gcd, a)))

-def gcd(x, y): -    if y == 0: -        return x -    return gcd(y, x % y) +from functools import reduce -N = int(eval(input())) +def gcd(a, b): +    if b == 0: +        return a +    return gcd(b, a % b) + + +n = int(eval(input())) -g = a[0] -for aa in a[1:]: -    g = gcd(g, aa) -print(g) +print((reduce(gcd, a)))