n = int(eval(input()))

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



from fractions import gcd



M = a[0]

         

for x in a[1:]:

    M = gcd(M, x)



print(M)
import functools,fractions

_=eval(input())

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

print((functools.reduce(fractions.gcd,a)))
n = int(eval(input()))
a = list(map(int, input().split()))
from fractions import gcd

M = a[0]
for x in a[1:]:
    M = gcd(M, x)
print(M)

import functools, fractions

_ = eval(input())
a = list(map(int, input().split()))
print((functools.reduce(fractions.gcd, a)))

-n = int(eval(input())) +import functools, fractions + +_ = eval(input()) -from fractions import gcd - -M = a[0] -for x in a[1:]: -    M = gcd(M, x) -print(M) +print((functools.reduce(fractions.gcd, a)))