N = int(eval(input()))

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

ans = min(A)

while True:

    for i in range(len(A)):

        if A[i] % ans != 0:

            A[i] %= ans

    if min(A) < ans:

        ans = min(A)

    else:

        break

print(ans)

import fractions

from functools import reduce



def gcd_list(numbers):

    return reduce(fractions.gcd, numbers)



N = int(eval(input()))

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



print((gcd_list(A)))

N = int(eval(input()))
A = list(map(int, input().split()))
ans = min(A)
while True:
    for i in range(len(A)):
        if A[i] % ans != 0:
            A[i] %= ans
    if min(A) < ans:
        ans = min(A)
    else:
        break
print(ans)

import fractions
from functools import reduce


def gcd_list(numbers):
    return reduce(fractions.gcd, numbers)


N = int(eval(input()))
A = list(map(int, input().split()))
print((gcd_list(A)))

+import fractions +from functools import reduce + + +def gcd_list(numbers): +    return reduce(fractions.gcd, numbers) + + -ans = min(A) -while True: -    for i in range(len(A)): -        if A[i] % ans != 0: -            A[i] %= ans -    if min(A) < ans: -        ans = min(A) -    else: -        break -print(ans) +print((gcd_list(A)))