from math import gcd



n = int(eval(input()))

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





for i in range(n-1):

  a[i+1] = gcd(a[i], a[i+1])

  

print((a[n-1]))
from math import gcd

n=int(eval(input()))

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

res=a[0]

for i in range(1,n):

  res=gcd(res,a[i])

print(res)
from math import gcd

n = int(eval(input()))
a = list(map(int, input().split()))
for i in range(n - 1):
    a[i + 1] = gcd(a[i], a[i + 1])
print((a[n - 1]))

from math import gcd

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

-for i in range(n - 1): -    a[i + 1] = gcd(a[i], a[i + 1]) -print((a[n - 1])) +res = a[0] +for i in range(1, n): +    res = gcd(res, a[i]) +print(res)