n = int(raw_input())
ais = map(int, raw_input().split())
def gcd(a,b):
	return gcd(b, a % b ) if b else a
print reduce(gcd, ais) n = int(raw_input()) n int(raw_input()) int raw_input() raw_input ais = map(int, raw_input().split()) ais map(int, raw_input().split()) map int raw_input().split() ().split () raw_input split def gcd(a,b):
	return gcd(b, a % b ) if b else a gcd return gcd(b, a % b ) if b else a gcd(b, a % b ) if b else a b gcd(b, a % b ) gcd b a % b a b a a a b b print reduce(gcd, ais) reduce gcd ais ais = map(int, raw_input().split()) map(int, raw_input().split()) ais n = int(raw_input()) int(raw_input()) n def gcd(a,b):
	return gcd(b, a % b ) if b else a def gcd(a,b):
	return gcd(b, a % b ) if b else a gcd
n = int(raw_input())
ais = map(int, raw_input().split())
def gcd(a,b):
	return gcd(b, a % b ) if b else a
print reduce(gcd, ais)