N = int(eval(input()))

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





# 最大公約数

def gcd(a, b):

    while b:

        a, b = b, a % b

    return a





while len(A) > 1:

    A.append(gcd(A.pop(), A.pop()))



print((A[0]))

from math import gcd

N = int(eval(input()))

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



while len(A) > 1:

    A.append(gcd(A.pop(), A.pop()))

print((A[0]))

N = int(eval(input()))
A = sorted(list(map(int, input().split())))
# 最大公約数
def gcd(a, b):
    while b:
        a, b = b, a % b
    return a


while len(A) > 1:
    A.append(gcd(A.pop(), A.pop()))
print((A[0]))

from math import gcd

N = int(eval(input()))
A = list(map(int, input().split()))
while len(A) > 1:
    A.append(gcd(A.pop(), A.pop()))
print((A[0]))

+from math import gcd + -A = sorted(list(map(int, input().split()))) -# 最大公約数 -def gcd(a, b): -    while b: -        a, b = b, a % b -    return a - - +A = list(map(int, input().split()))