import System.IO
import qualified Data.Text.Lazy as L

main :: IO()
main = do
	iline <- getLine
    iline <- getLine
    let itext = L.pack iline
    let nums = map readNum (L.words itext)
    print (gGcd nums)

readNum str = read (L.unpack str) :: Int

gGcd (x:y:[]) = gcd x y
gGcd (x:xs) = gcd x (gGcd xs)
