from fractions import gcd

n=int(eval(input()))

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

for s in range(len(a)-1):

  if s==0:x=a[s]

  x=gcd(x,a[s+1])

print(x)
from fractions import*

from functools import*

n,*a=list(map(int,open(0).read().split()))

print((reduce(gcd,a)))
from fractions import gcd

n = int(eval(input()))
a = list(map(int, input().split()))
for s in range(len(a) - 1):
    if s == 0:
        x = a[s]
    x = gcd(x, a[s + 1])
print(x)

from fractions import *
from functools import *

n, *a = list(map(int, open(0).read().split()))
print((reduce(gcd, a)))

-from fractions import gcd +from fractions import * +from functools import * -n = int(eval(input())) -a = list(map(int, input().split())) -for s in range(len(a) - 1): -    if s == 0: -        x = a[s] -    x = gcd(x, a[s + 1]) -print(x) +n, *a = list(map(int, open(0).read().split())) +print((reduce(gcd, a)))