import Data.List
import Control.Applicative
import Control.Monad

getDivisor :: Int -> [Int]
getDivisor n = [m | m <- [1..n], n `mod` m == 0]

getCommon :: [Int] -> [Int] -> [Int]
getCommon xs ys = [x | x <- xs, y <- ys, x == y]

main :: IO ()
main = do
  getLine
  xs <- fmap read . words <$> getLine :: IO [Int]
  let cds = foldr1 getCommon $ fmap getDivisor xs
  putStr . unlines $ show <$> cds
