import Data.List

solve (x:xs) = foldl' step x xs
    where
        step a x
            | res == 0 = a
            | otherwise = min a res
                where
                    res = x `mod` a


main = do 
    getLine
    xs <- sort . map read . words <$> getLine :: IO [Int]
    print $ solve xs