from fractions import gcd

N = int(eval(input()))

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



g = 0

for i in range(N):

    g = gcd(g, A[i])

print(g)
N = int(eval(input()))

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



def gcd(p,q):

    if q == 0: return p

    return gcd(q, p%q)



g = 0

for i in range(N):

    g = gcd(g, A[i])

print(g)
from fractions import gcd

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

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


def gcd(p, q):
    if q == 0:
        return p
    return gcd(q, p % q)


g = 0
for i in range(N):
    g = gcd(g, A[i])
print(g)

-from fractions import gcd - + + +def gcd(p, q): +    if q == 0: +        return p +    return gcd(q, p % q) + +