import fractions

n = int(eval(input()))

a = [int(x) for x in input().split()]



ans = a[0]



for i in range(1,n):

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



print(ans)
from fractions import gcd

from functools import reduce

n = int(eval(input()))

a = [int(x) for x in input().split()]



def gcd_list(l):

    return reduce(gcd, l)



print((gcd_list(a)))
import fractions

n = int(eval(input()))
a = [int(x) for x in input().split()]
ans = a[0]
for i in range(1, n):
    ans = fractions.gcd(ans, a[i])
print(ans)

from fractions import gcd
from functools import reduce

n = int(eval(input()))
a = [int(x) for x in input().split()]


def gcd_list(l):
    return reduce(gcd, l)


print((gcd_list(a)))

-import fractions +from fractions import gcd +from functools import reduce -ans = a[0] -for i in range(1, n): -    ans = fractions.gcd(ans, a[i]) -print(ans) + + +def gcd_list(l): +    return reduce(gcd, l) + + +print((gcd_list(a)))