local function gcd(a,b)
    if b>0 then
        return gcd(b,a%b)
    else
        return a
    end
end

local n=io.read("*n")
local a={}
for i=1,n do
    a[i]=io.read("*n")
end
for i=1,n-1 do
    a[i+1]=gcd(a[i],a[i+1])
end
print(a[n])