import fractions

n = int(eval(input()))

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

#入力



def gcd(a):

    ans = a[0]

    n = len(a)

    for i in range(1,n):

        ans = fractions.gcd(ans,a[i])

    return ans



print((gcd(a)))
from fractions import gcd

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)
import fractions

n = int(eval(input()))
a = list(map(int, input().split()))
# 入力
def gcd(a):
    ans = a[0]
    n = len(a)
    for i in range(1, n):
        ans = fractions.gcd(ans, a[i])
    return ans


print((gcd(a)))

from fractions import gcd

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)

-import fractions +from fractions import gcd -# 入力 -def gcd(a): -    ans = a[0] -    n = len(a) -    for i in range(1, n): -        ans = fractions.gcd(ans, a[i]) -    return ans - - -print((gcd(a))) +x = a[0] +for i in range(1, n): +    x = gcd(x, a[i]) +print(x)