from fractions import gcd





eval(input())

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

ans = next(A)

for a in A:

    ans = gcd(ans, a)

print(ans)

from fractions import gcd

from functools import reduce





eval(input())

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

print((reduce(gcd, A)))

from fractions import gcd

eval(input())
A = list(map(int, input().split()))
ans = next(A)
for a in A:
    ans = gcd(ans, a)
print(ans)

from fractions import gcd
from functools import reduce

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

+from functools import reduce -ans = next(A) -for a in A: -    ans = gcd(ans, a) -print(ans) +print((reduce(gcd, A)))