import std.stdio, std.string, std.range, std.conv, std.array, std.algorithm, std.math, std.typecons;

void main() {
    const N = readln.chomp.to!long;
    auto as = readln.split.to!(long[]);
    auto res = long.max;
    while (true) {
        auto candidates = as.filter!(a => a > 0);
        if (candidates.empty) break;
        const m = candidates.reduce!min;
        foreach (ref a; as) 
            if (a != m)
                a %= m;
        res = min(res, m);
        if (candidates.all!(a => a == m)) break;
    }
    writeln(res);
}

