N=int(input())
A=list(map(int, input().split()))

def gcd(a,b):
	while b:
		a, b = b, a%b
	return a


ans=0
for a in A:
	ans=gcd(ans, a)
print(ans) N=int(input()) N int(input()) int input() input A=list(map(int, input().split())) A list(map(int, input().split())) list map(int, input().split()) map int input().split() ().split () input split def gcd(a,b):
	while b:
		a, b = b, a%b
	return a gcd while b:
		a, b = b, a%b
	 b a, b = b, a%b a b b a%b a b return a a a a b b ans=0 ans 0 for a in A:
	ans=gcd(ans, a) a A ans=gcd(ans, a) ans gcd(ans, a) gcd ans a print(ans) print ans ans=0 0 ans N=int(input()) int(input()) N def gcd(a,b):
	while b:
		a, b = b, a%b
	return a def gcd(a,b):
	while b:
		a, b = b, a%b
	return a gcd A=list(map(int, input().split())) list(map(int, input().split())) A ans=gcd(ans, a) gcd(ans, a) ans
N=int(input())
A=list(map(int, input().split()))

def gcd(a,b):
	while b:
		a, b = b, a%b
	return a


ans=0
for a in A:
	ans=gcd(ans, a)
print(ans)