import numpy as np

N=int(eval(input()))

# A=list(map(int,input().split()))

A=[int(i) for i in input().split()]

A=np.array(sorted(A))



while np.any(A[:-1]>0):

    try:

        m=sorted(list(A[A>0]))[0]

        A=list(A[1:]%m)

        A.append(m)

        A=np.array(A)



    except:

        continue

print(m)

def gcd(a,b):

    while b!=0:

        a,b=b,a%b

    return a



N=int(eval(input()))

# A=list(map(int,input().split()))

A=[int(i) for i in input().split()]



m=0

for a in A:

    m=gcd(a,m)

print(m)
import numpy as np

N = int(eval(input()))
# A=list(map(int,input().split()))
A = [int(i) for i in input().split()]
A = np.array(sorted(A))
while np.any(A[:-1] > 0):
    try:
        m = sorted(list(A[A > 0]))[0]
        A = list(A[1:] % m)
        A.append(m)
        A = np.array(A)
    except:
        continue
print(m)

def gcd(a, b):
    while b != 0:
        a, b = b, a % b
    return a


N = int(eval(input()))
# A=list(map(int,input().split()))
A = [int(i) for i in input().split()]
m = 0
for a in A:
    m = gcd(a, m)
print(m)

-import numpy as np +def gcd(a, b): +    while b != 0: +        a, b = b, a % b +    return a + -A = np.array(sorted(A)) -while np.any(A[:-1] > 0): -    try: -        m = sorted(list(A[A > 0]))[0] -        A = list(A[1:] % m) -        A.append(m) -        A = np.array(A) -    except: -        continue +m = 0 +for a in A: +    m = gcd(a, m)