N = int(eval(input()))

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

L = sorted(L)

while True:

    for i in range(1,len(L)):

        L[i] %= L[0]

    L= [x for x in L if x!=0]

    L= sorted(L)

    if len(L) == 1:

        break

print((L[0]))

def gcd(x , y):

    if x < y:

        x , y = y , x

    if y == 0:

        return x

    r = x % y

    return gcd(y , r)



N = int(eval(input()))

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

ans = L[0]

for i in range(len(L)):

    ans = gcd( ans ,L[i] )

print(ans)

N = int(eval(input()))
L = list(map(int, input().split()))
L = sorted(L)
while True:
    for i in range(1, len(L)):
        L[i] %= L[0]
    L = [x for x in L if x != 0]
    L = sorted(L)
    if len(L) == 1:
        break
print((L[0]))

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


N = int(eval(input()))
L = list(map(int, input().split()))
ans = L[0]
for i in range(len(L)):
    ans = gcd(ans, L[i])
print(ans)

+def gcd(x, y): +    if x < y: +        x, y = y, x +    if y == 0: +        return x +    r = x % y +    return gcd(y, r) + + -L = sorted(L) -while True: -    for i in range(1, len(L)): -        L[i] %= L[0] -    L = [x for x in L if x != 0] -    L = sorted(L) -    if len(L) == 1: -        break -print((L[0])) +ans = L[0] +for i in range(len(L)): +    ans = gcd(ans, L[i]) +print(ans)