N = int(eval(input()))

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

A.sort()

min_ptn = A[1]

for i in range(min_ptn,0,-1):

  count = 0

  for a in A:

    if a%i!=0:

      count+=1

    if count>1:

      break

  if count<2:

    print(i)

    break
def gcd(x,y):

    if x<y:x,y =y,x

    if y==0: return x

    return gcd(y,x%y)

N = int(eval(input()))

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

L = [0]

R = [0]

M = []

for i in range(N):

    L.append(gcd(L[i],A[i]))

    R.append(gcd(R[i],A[N-i-1]))

R.reverse()

print((max([gcd(L[i],R[i+1])for i in range(N)])))
N = int(eval(input()))
A = list(map(int, input().split()))
A.sort()
min_ptn = A[1]
for i in range(min_ptn, 0, -1):
    count = 0
    for a in A:
        if a % i != 0:
            count += 1
        if count > 1:
            break
    if count < 2:
        print(i)
        break

def gcd(x, y):
    if x < y:
        x, y = y, x
    if y == 0:
        return x
    return gcd(y, x % y)


N = int(eval(input()))
A = list(map(int, input().split()))
L = [0]
R = [0]
M = []
for i in range(N):
    L.append(gcd(L[i], A[i]))
    R.append(gcd(R[i], A[N - i - 1]))
R.reverse()
print((max([gcd(L[i], R[i + 1]) for i in range(N)])))

+def gcd(x, y): +    if x < y: +        x, y = y, x +    if y == 0: +        return x +    return gcd(y, x % y) + + -A.sort() -min_ptn = A[1] -for i in range(min_ptn, 0, -1): -    count = 0 -    for a in A: -        if a % i != 0: -            count += 1 -        if count > 1: -            break -    if count < 2: -        print(i) -        break +L = [0] +R = [0] +M = [] +for i in range(N): +    L.append(gcd(L[i], A[i])) +    R.append(gcd(R[i], A[N - i - 1])) +R.reverse() +print((max([gcd(L[i], R[i + 1]) for i in range(N)])))