import fractions



N = int(eval(input()))

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

ans = A[0]

for i in range(1, N):

    ans = fractions.gcd(ans, A[i])

    

print(ans)
import math

from functools import reduce



def gcd(v1, v2):

    if v1 == 0 or v2 == 0:

        return max(v1, v2)

    if v1 % v2 == 0:

        return v2

    return gcd(v2, v1%v2)



N = int(eval(input()))

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



print((reduce(gcd, A)))
import fractions

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

import math
from functools import reduce


def gcd(v1, v2):
    if v1 == 0 or v2 == 0:
        return max(v1, v2)
    if v1 % v2 == 0:
        return v2
    return gcd(v2, v1 % v2)


N = int(eval(input()))
A = list(map(int, input().split()))
print((reduce(gcd, A)))

-import fractions +import math +from functools import reduce + + +def gcd(v1, v2): +    if v1 == 0 or v2 == 0: +        return max(v1, v2) +    if v1 % v2 == 0: +        return v2 +    return gcd(v2, v1 % v2) + -ans = A[0] -for i in range(1, N): -    ans = fractions.gcd(ans, A[i]) -print(ans) +print((reduce(gcd, A)))