from fractions import gcd

N = int(eval(input()))

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

g = A[0]

for a in A:

    g = gcd(g,a)

print(g)
from math import gcd

N = int(eval(input()))

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

g = 0

for a in A:

    g = gcd(a,g)

print(g)
from fractions import gcd

N = int(eval(input()))
A = list(map(int, input().split()))
g = A[0]
for a in A:
    g = gcd(g, a)
print(g)

from math import gcd

N = int(eval(input()))
A = list(map(int, input().split()))
g = 0
for a in A:
    g = gcd(a, g)
print(g)

-from fractions import gcd +from math import gcd -g = A[0] +g = 0 -    g = gcd(g, a) +    g = gcd(a, g)