n=int(eval(input()))

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



minA=min(A)

while len(A)!=1:

    B=[]

    for i in range(len(A)):

        if A[i]%minA!=0:

            B.append(A[i]%minA)

    B.append(minA)

    A=B

    minA=min(A)

print(minA)
from fractions import gcd

from functools import reduce





def lcm_list(numbers):

    return reduce(gcd,numbers)





n=int(eval(input()))

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

print((lcm_list(A)))
n = int(eval(input()))
A = sorted(list(map(int, input().split())))
minA = min(A)
while len(A) != 1:
    B = []
    for i in range(len(A)):
        if A[i] % minA != 0:
            B.append(A[i] % minA)
    B.append(minA)
    A = B
    minA = min(A)
print(minA)

from fractions import gcd
from functools import reduce


def lcm_list(numbers):
    return reduce(gcd, numbers)


n = int(eval(input()))
A = sorted(list(map(int, input().split())))
print((lcm_list(A)))

+from fractions import gcd +from functools import reduce + + +def lcm_list(numbers): +    return reduce(gcd, numbers) + + -minA = min(A) -while len(A) != 1: -    B = [] -    for i in range(len(A)): -        if A[i] % minA != 0: -            B.append(A[i] % minA) -    B.append(minA) -    A = B -    minA = min(A) -print(minA) +print((lcm_list(A)))