import Data.List

main = do
    n <- read <$> getLine    
    ls <- map read . words <$> getLine
    print $ maximum $ map (listGcd . hoge ls) [1..n]
    where listGcd l = foldl1' (\a b -> gcd a b) l
          hoge [] i = []
          hoge l  1 = hoge (tail l) 0
          hoge l  i = head l : hoge (tail l) (i - 1)
