import itertools
import fractions
n=int(input())
a=list(map(int,input().split()))
a.sort()
mina=a[0]
ans = 10**18
for i in range(n):
	ans = min(ans, fractions.gcd(a[i], mina))
print(ans) import itertools itertools import fractions fractions 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 a.sort() a.sort a sort mina=a[0] mina a[0] a 0 ans = 10**18 ans 10**18 10 18 for i in range(n):
	ans = min(ans, fractions.gcd(a[i], mina)) i range(n) range n ans = min(ans, fractions.gcd(a[i], mina)) ans min(ans, fractions.gcd(a[i], mina)) min ans fractions.gcd(a[i], mina) fractions.gcd fractions gcd a[i] a i mina print(ans) print ans ans = min(ans, fractions.gcd(a[i], mina)) min(ans, fractions.gcd(a[i], mina)) ans a=list(map(int,input().split())) list(map(int,input().split())) a n=int(input()) int(input()) n ans = 10**18 10**18 ans mina=a[0] a[0] mina
import itertools
import fractions
n=int(input())
a=list(map(int,input().split()))
a.sort()
mina=a[0]
ans = 10**18
for i in range(n):
	ans = min(ans, fractions.gcd(a[i], mina))
print(ans)