import Data.List

main = do
    _ <- getLine
    as <- map read . words <$> getLine
    print $ solve as

solve :: [Int] -> Int
solve xs = let (x':xs') = sort xs
               (y:ys) = x':(map (`mod` x') xs')
               in if all (==0) ys then y
                                  else solve . filter (/= 0) $ (y:ys)