def gcd(a, b):

    if b == 0:

        return a

    else:

        return gcd(b, a % b)

N = int(eval(input()))

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

A.sort(reverse=True)

a = A[0]

for i in range(1,N):

    a = gcd(a,A[i])

print(a)

def gcd(a, b):

    if b > a:

        a,b = b,a

    if b == 0:

        return a

    else:

        return gcd(b, a % b)

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(a, b):
    if b == 0:
        return a
    else:
        return gcd(b, a % b)


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

def gcd(a, b):
    if b > a:
        a, b = b, a
    if b == 0:
        return a
    else:
        return gcd(b, a % b)


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)

+    if b > a: +        a, b = b, a -A.sort(reverse=True)