import fractions





N = int(eval(input()))

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



 

ans = fractions.gcd(A[0], A[1])



for i in range(2, N):

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



print(ans)

import fractions

from functools import reduce





N = int(eval(input()))

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



ans = reduce(fractions.gcd, A)

print(ans)

import fractions

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

import fractions
from functools import reduce

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

+from functools import reduce -ans = fractions.gcd(A[0], A[1]) -for i in range(2, N): -    ans = fractions.gcd(ans, A[i]) +ans = reduce(fractions.gcd, A)