import qualified Data.Vector.Unboxed as V

main :: IO ()
main = do
  n <- readLn
  as <- V.fromListN n . map read . words <$> getLine
  print $ solve as

solve :: V.Vector Int -> Int
solve = V.foldr1' gcd