def gcd(a,b):

    if b>a:

        a,b=b,a

    while b:

        a,b=b, a%b

    return a





def cul(n,x):

    l=len(x)

    b=[x[i] for i in range(l)]

    b.pop(n)

    tmp=b[0]

    for i in range(1,l-1):

        tmp=gcd(tmp,b[i])

    return tmp



import sys

import math

p=100

N=int(eval(input()))

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

if N<=p:

    ans=0

    

    for i in range(N):

        tmp=cul(i,a)        

        if tmp>ans: ans=tmp

    print(ans)

    sys.exit()

        

M=a[0]

for i in range(1,p):

    M=gcd(M,a[i])



ans=0





R=a[p]

for i in range(p,N):

    r=gcd(R,a[i])



if r>ans:

    for i in range(p):

        s=gcd(cul(i,a[:p]),R)

        if s>ans: ans=s



print(ans)

def gcd(a,b):

    if b>a:

        a,b=b,a

    while b:

        a,b=b, a%b

    return a





def cul(n,x):

    l=len(x)

    b=[x[i] for i in range(l)]

    b.pop(n)

    tmp=b[0]

    for i in range(1,l-1):

        tmp=gcd(tmp,b[i])

    return tmp



import sys

import math

p=100

N=int(eval(input()))

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

if N<=p:

    ans=0

    

    for i in range(N):

        tmp=cul(i,a)        

        if tmp>ans: ans=tmp

    print(ans)

    sys.exit()

        

M=a[0]

for i in range(1,p):

    M=gcd(M,a[i])



ans=0

for i in range(p):

    s=gcd(cul(i,a[:p]),a[p])

    if s>ans: ans=s



print(ans)
def gcd(a, b):
    if b > a:
        a, b = b, a
    while b:
        a, b = b, a % b
    return a


def cul(n, x):
    l = len(x)
    b = [x[i] for i in range(l)]
    b.pop(n)
    tmp = b[0]
    for i in range(1, l - 1):
        tmp = gcd(tmp, b[i])
    return tmp


import sys
import math

p = 100
N = int(eval(input()))
a = list(map(int, input().split()))
if N <= p:
    ans = 0
    for i in range(N):
        tmp = cul(i, a)
        if tmp > ans:
            ans = tmp
    print(ans)
    sys.exit()
M = a[0]
for i in range(1, p):
    M = gcd(M, a[i])
ans = 0
R = a[p]
for i in range(p, N):
    r = gcd(R, a[i])
if r > ans:
    for i in range(p):
        s = gcd(cul(i, a[:p]), R)
        if s > ans:
            ans = s
print(ans)

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


def cul(n, x):
    l = len(x)
    b = [x[i] for i in range(l)]
    b.pop(n)
    tmp = b[0]
    for i in range(1, l - 1):
        tmp = gcd(tmp, b[i])
    return tmp


import sys
import math

p = 100
N = int(eval(input()))
a = list(map(int, input().split()))
if N <= p:
    ans = 0
    for i in range(N):
        tmp = cul(i, a)
        if tmp > ans:
            ans = tmp
    print(ans)
    sys.exit()
M = a[0]
for i in range(1, p):
    M = gcd(M, a[i])
ans = 0
for i in range(p):
    s = gcd(cul(i, a[:p]), a[p])
    if s > ans:
        ans = s
print(ans)

-R = a[p] -for i in range(p, N): -    r = gcd(R, a[i]) -if r > ans: -    for i in range(p): -        s = gcd(cul(i, a[:p]), R) -        if s > ans: -            ans = s +for i in range(p): +    s = gcd(cul(i, a[:p]), a[p]) +    if s > ans: +        ans = s