from fractions import gcd



n=int(eval(input()))

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

ans=10**18

t=0

for i in range(1,n):

  if i==1:

    t=gcd(a[0],a[1])

    ans=min(ans,t)

    continue

  t=gcd(t,a[i])

  ans=min(t,ans)

print(ans)

from math import gcd

n=int(eval(input()))

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

t=a[0]

for i in range(1,n):

  t=gcd(t,a[i])

print(t)

from fractions import gcd

n = int(eval(input()))
a = list(map(int, input().split()))
ans = 10**18
t = 0
for i in range(1, n):
    if i == 1:
        t = gcd(a[0], a[1])
        ans = min(ans, t)
        continue
    t = gcd(t, a[i])
    ans = min(t, ans)
print(ans)

from math import gcd

n = int(eval(input()))
a = list(map(int, input().split()))
t = a[0]
for i in range(1, n):
    t = gcd(t, a[i])
print(t)

-from fractions import gcd +from math import gcd -ans = 10**18 -t = 0 +t = a[0] -    if i == 1: -        t = gcd(a[0], a[1]) -        ans = min(ans, t) -        continue -    ans = min(t, ans) -print(ans) +print(t)