from functools import reduce

from fractions import gcd



n = int(eval(input()))

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



print((reduce(gcd, a)))

import sys

stdin = sys.stdin

sys.setrecursionlimit(10 ** 7)

from functools import reduce



i_i = lambda: int(i_s())

i_l = lambda: list(map(int, stdin.readline().split()))

i_s = lambda: stdin.readline().rstrip()



def gcd(a,b):

    while b:

        a, b = b, a%b

    return a



def gcd_list(l):

    return reduce(gcd, l)



N = i_i()

A = i_l()



print((gcd_list(A)))
from functools import reduce
from fractions import gcd

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

import sys

stdin = sys.stdin
sys.setrecursionlimit(10**7)
from functools import reduce

i_i = lambda: int(i_s())
i_l = lambda: list(map(int, stdin.readline().split()))
i_s = lambda: stdin.readline().rstrip()


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


def gcd_list(l):
    return reduce(gcd, l)


N = i_i()
A = i_l()
print((gcd_list(A)))

+import sys + +stdin = sys.stdin +sys.setrecursionlimit(10**7) -from fractions import gcd -n = int(eval(input())) -a = list(map(int, input().split())) -print((reduce(gcd, a))) +i_i = lambda: int(i_s()) +i_l = lambda: list(map(int, stdin.readline().split())) +i_s = lambda: stdin.readline().rstrip() + + +def gcd(a, b): +    while b: +        a, b = b, a % b +    return a + + +def gcd_list(l): +    return reduce(gcd, l) + + +N = i_i() +A = i_l() +print((gcd_list(A)))