n = int(eval(input()))

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

def gcd(a,b):

  if b==0:

    return a

  return gcd(b, a%b)



ans = gcd(aaa[0], aaa[1])

if n == 2:

  print(ans)

else:

  for i in range(2,n):

    ans = gcd(ans, aaa[i])

  print(ans)

  
from functools import reduce

from fractions import gcd

def gcd_list(numbers):

    return reduce(gcd, numbers)



def resolve():

    n = int(eval(input()))

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

    print((gcd_list(aaa)))

resolve()
n = int(eval(input()))
aaa = list(map(int, input().split()))


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


ans = gcd(aaa[0], aaa[1])
if n == 2:
    print(ans)
else:
    for i in range(2, n):
        ans = gcd(ans, aaa[i])
    print(ans)

from functools import reduce
from fractions import gcd


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


def resolve():
    n = int(eval(input()))
    aaa = list(map(int, input().split()))
    print((gcd_list(aaa)))


resolve()

-n = int(eval(input())) -aaa = list(map(int, input().split())) +from functools import reduce +from fractions import gcd -def gcd(a, b): -    if b == 0: -        return a -    return gcd(b, a % b) +def gcd_list(numbers): +    return reduce(gcd, numbers) -ans = gcd(aaa[0], aaa[1]) -if n == 2: -    print(ans) -else: -    for i in range(2, n): -        ans = gcd(ans, aaa[i]) -    print(ans) +def resolve(): +    n = int(eval(input())) +    aaa = list(map(int, input().split())) +    print((gcd_list(aaa))) + + +resolve()