N = int(eval(input()))

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



def gcd(a,b):

    while b!=0:

        a,b=b,a%b

    return a



gcd_a = A[0]



for i in A:

    gcd_a = gcd(gcd_a,i)



print(gcd_a)
from math import gcd



N = int(eval(input()))

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



g = A[0]



for i in A:

    g = gcd(g,i)



print(g)

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


def gcd(a, b):
    while b != 0:
        a, b = b, a % b
    return a


gcd_a = A[0]
for i in A:
    gcd_a = gcd(gcd_a, i)
print(gcd_a)

from math import gcd

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

+from math import gcd + - - -def gcd(a, b): -    while b != 0: -        a, b = b, a % b -    return a - - -gcd_a = A[0] +g = A[0] -    gcd_a = gcd(gcd_a, i) -print(gcd_a) +    g = gcd(g, i) +print(g)