def gcd(x,y):

    while y>0:

        x,y = y,x%y

    return x

N = int(eval(input()))

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

a = A[0]

for i in range(1,N):

    a = gcd(a,A[i])

print(a)
def gcd(x,y):

    while y>0:

        x,y = y,x%y

    return x

N = int(eval(input()))

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

x = A[0]

for i in range(1,N):

    x = gcd(x,A[i])

print(x)
def gcd(x, y):
    while y > 0:
        x, y = y, x % y
    return x


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

def gcd(x, y):
    while y > 0:
        x, y = y, x % y
    return x


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

-a = A[0] +x = A[0] -    a = gcd(a, A[i]) -print(a) +    x = gcd(x, A[i]) +print(x)