# ABC118 C - Monsters Battle Royale

from fractions import gcd

n = int(eval(input()))

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

ans = 10**10



for i in range(n-1):

    t = gcd(a[i],a[i+1])

    ans = min(ans,t)

print(ans)



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)

# ABC118 C - Monsters Battle Royale
from fractions import gcd

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

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)

-# ABC118 C - Monsters Battle Royale -ans = 10**10 -for i in range(n - 1): -    t = gcd(a[i], a[i + 1]) -    ans = min(ans, t) +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)