function parse_table(N)
    local tbl = {}
    for i=1,N do
        table.insert(tbl, io.read("n"))
    end
    return tbl
end
function gcd(a,b)
    if b == 0 then
        return a
    else
        return gcd(b, a % b)
    end
end
function gcd_tbl(tbl)
    local ans = tbl[1]
    for i=2,#tbl do
        ans = gcd(ans, tbl[i])
    end
    return ans
end
function main()
    local n = io.read("n")
    io.read("l")
    local hptbl = parse_table(n)
    local ans = gcd_tbl(hptbl)
    print(ans)
end
main()
