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 functools

from fractions import gcd

n = int(eval(input()))

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

print((functools.reduce(gcd,li))) 
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 functools
from fractions import gcd

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

-import fractions +import functools +from fractions import gcd -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) +n = int(eval(input())) +li = list(map(int, input().split())) +print((functools.reduce(gcd, li)))