_gcd = function(m, n, t) {
	while (m % n !== 0) {
		t = n;
		n = m % n;
		m = t;
	}
	return n;
}

input = require('fs').readFileSync('/dev/stdin', 'utf8')
lines = input.split('\n')
N = lines.shift() * 1
line = lines.shift().split(' ')
gcd = line[0]
for (i=1; i<N; i++) {
    gcd = _gcd(gcd, line[i])
}
console.log(gcd)