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

/// 数列の読み込み
auto readNums(T = int)() {
	return readln().chomp.split.map!(to!T).array;
}

auto minElement(R)(R r) {
    return r.reduce!((a, b) => min(a, b));
}

void main() {
	immutable n = readNums()[0];
	auto monsters = readNums();
	int min = 0;
	while(monsters.length > 1) {
		min = monsters.minElement;
		monsters = monsters.map!((a) => a % min).filter!"a != 0".array;
		monsters ~= min;
	}
	writefln("%s", min);
}