def gcd(_a, _b):
	if _a%_b==0:return _b
	else:return gcd(_b, _a%_b)

n=int(input())
a=sorted(map(int,input().split()))
INF=2*10**9
ans=INF
for i in range(len(a)-1):
	tmp=gcd(a[i],a[i+1])
	if tmp!=0 and tmp<ans:
		ans=tmp
print(ans) def gcd(_a, _b):
	if _a%_b==0:return _b
	else:return gcd(_b, _a%_b) gcd if _a%_b==0:return _b
	else:return gcd(_b, _a%_b) _a%_b==0 _a%_b _a _b 0 _a _a _b _b n=int(input()) n int(input()) int input() input a=sorted(map(int,input().split())) a sorted(map(int,input().split())) sorted map(int,input().split()) map int input().split() ().split () input split INF=2*10**9 INF 2*10**9 2 10**9 10 9 ans=INF ans INF for i in range(len(a)-1):
	tmp=gcd(a[i],a[i+1])
	if tmp!=0 and tmp<ans:
		ans=tmp i range(len(a)-1) range len(a)-1 len(a) len a 1 tmp=gcd(a[i],a[i+1]) tmp gcd(a[i],a[i+1]) gcd a[i] a i a[i+1] a i+1 i 1 if tmp!=0 and tmp<ans:
		ans=tmp tmp!=0 and tmp<ans tmp!=0 tmp 0 tmp<ans tmp ans ans=tmp ans tmp print(ans) print ans ans=INF INF ans n=int(input()) int(input()) n a=sorted(map(int,input().split())) sorted(map(int,input().split())) a ans=tmp tmp ans INF=2*10**9 2*10**9 INF tmp=gcd(a[i],a[i+1]) gcd(a[i],a[i+1]) tmp def gcd(_a, _b):
	if _a%_b==0:return _b
	else:return gcd(_b, _a%_b) def gcd(_a, _b):
	if _a%_b==0:return _b
	else:return gcd(_b, _a%_b) gcd
def gcd(_a, _b):
	if _a%_b==0:return _b
	else:return gcd(_b, _a%_b)

n=int(input())
a=sorted(map(int,input().split()))
INF=2*10**9
ans=INF
for i in range(len(a)-1):
	tmp=gcd(a[i],a[i+1])
	if tmp!=0 and tmp<ans:
		ans=tmp
print(ans)