import fractions as fr



N = int(eval(input()))



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



ans = A[0]



for i in range(1,N) :

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

    if ans == 1 :

        break



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

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



def gcd(n, m):

    if m == 0:

        return n

    return gcd(m, n % m)



G = A[0]

for a in A:

    G = gcd(G, a)



print(G)

import fractions as fr

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

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


def gcd(n, m):
    if m == 0:
        return n
    return gcd(m, n % m)


G = A[0]
for a in A:
    G = gcd(G, a)
print(G)

-import fractions as fr - -ans = A[0] -for i in range(1, N): -    ans = fr.gcd(ans, A[i]) -    if ans == 1: -        break -print(ans) + + +def gcd(n, m): +    if m == 0: +        return n +    return gcd(m, n % m) + + +G = A[0] +for a in A: +    G = gcd(G, a) +print(G)