import Data.List

main = do
    n <- readLn :: IO Int
    as_inp <- map read . words <$> getLine :: IO [Int]
    let as = sort as_inp
    print $ head $ attack as


attack :: [Int] -> [Int]
attack [a] = [a]
attack (a:as) = attack $ sort (a : (filter (/=0) $ map (\x -> x `mod` a) as))