import fractions



N = int(eval(input()))

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

L = [0] * N

R = [0] * N

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

    L[i + 1] = fractions.gcd(L[i], A[i])

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

    R[i - 1] = fractions.gcd(R[i], A[i])

ans = 1

for i in range(N):

    ans = max(ans, fractions.gcd(L[i], R[i]))

print(ans)

import fractions



N = int(eval(input()))

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

L = [0] * N

R = [0] * N

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

    L[i + 1] = fractions.gcd(L[i], A[i])

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

    R[i - 1] = fractions.gcd(R[i], A[i])

print((max([fractions.gcd(L[i], R[i]) for i in range(N)])))

import fractions

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

import fractions

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

-ans = 1 -for i in range(N): -    ans = max(ans, fractions.gcd(L[i], R[i])) -print(ans) +print((max([fractions.gcd(L[i], R[i]) for i in range(N)])))