import Prelude

main = do
    _ <- getLine
    a <- map read . words <$> getLine
    putStrLn $ show $ max (gcd (head a) (last a)) (solv a)

solv :: [Int] -> Int
solv [x] = 1
solv (x:y:xs) = max (gcd x y) (solv $ y:xs)
