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



getBysplit = map read . words <$> getLine

main :: IO()
main = do
  n <- readLn :: IO Int
  alst <- getBysplit :: IO [Int]
  let ans = foldl gcd (head alst) alst
  print ans
