gcd' = foldl1 gcd

del :: Int -> [Int] -> [Int]
del i = map (\(j,x) -> if i == j then 0 else x) . zip [0..]

main :: IO ()
main = do
    n <- readLn :: IO Int
    a <- map read . words <$> getLine :: IO [Int]
    print . maximum $ map (gcd' . flip del a) [0..n-1]