import Control.Monad
import Data.List
main = do
    n <- readLn
    a <- map read . words <$> getLine
    let ml = take n (scanl (gcd) 0 a)
    let mr = drop 1 (scanr (gcd) 0 a)
    let m = zipWith (gcd) ml mr
    print (maximum m)