import Control.Monad
import Data.List

main = do
    n <- read <$> getLine
    a <- fmap read <$> words <$> getLine
    putStrLn $ show $ solve n a

solve :: Int -> [Int] -> Int
solve n a = foldl1' gcd a