import Data.List
main = do
  _ <- getLine
  a <- map read . words <$> getLine
  let c = last (init (sort a))
  print $ f a c
f xs y
  | length (filter (\x -> x `mod` y /= 0) xs) > 1 = f xs (y-1)
  | otherwise = y
