def gcdf(a):

    a.sort()

    a0=a[0]

    a=[int(x%a0) for x in a if x%a0 != 0]

    if len(a)==0:

        return a0

    else:

        a.append(a0)

        a0=min(a)

        return gcdf(a) 



n=int(eval(input()))

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



gcdx=gcdf(a)

print(gcdx)



from functools import reduce

#from math import gcd

from fractions import gcd



n=int(eval(input()))

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



print((reduce(gcd,a)))    
def gcdf(a):
    a.sort()
    a0 = a[0]
    a = [int(x % a0) for x in a if x % a0 != 0]
    if len(a) == 0:
        return a0
    else:
        a.append(a0)
        a0 = min(a)
        return gcdf(a)


n = int(eval(input()))
a = list(map(int, input().split()))
gcdx = gcdf(a)
print(gcdx)

from functools import reduce

# from math import gcd
from fractions import gcd

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

-def gcdf(a): -    a.sort() -    a0 = a[0] -    a = [int(x % a0) for x in a if x % a0 != 0] -    if len(a) == 0: -        return a0 -    else: -        a.append(a0) -        a0 = min(a) -        return gcdf(a) +from functools import reduce +# from math import gcd +from fractions import gcd -gcdx = gcdf(a) -print(gcdx) +print((reduce(gcd, a)))