def gcd(x,y):
    if x%y==0: return y
    else: return gcd(y,x%y)
n = int(input())
a = list(map(int,input().split()))
a.sort()
ans = a[0]
for i in range(1,n):
    ans = min(ans,gcd(ans,a[i]))
print(ans) def gcd(x,y):
    if x%y==0: return y
    else: return gcd(y,x%y) gcd if x%y==0: return y
    else: return gcd(y,x%y) x%y==0 x%y x y 0 x x y y 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 ans = a[0] ans a[0] a 0 for i in range(1,n):
    ans = min(ans,gcd(ans,a[i])) i range(1,n) range 1 n ans = min(ans,gcd(ans,a[i])) ans min(ans,gcd(ans,a[i])) min ans gcd(ans,a[i]) gcd ans a[i] a i print(ans) print ans ans = min(ans,gcd(ans,a[i])) min(ans,gcd(ans,a[i])) ans n = int(input()) int(input()) n a = list(map(int,input().split())) list(map(int,input().split())) a ans = a[0] a[0] ans def gcd(x,y):
    if x%y==0: return y
    else: return gcd(y,x%y) def gcd(x,y):
    if x%y==0: return y
    else: return gcd(y,x%y) gcd
def gcd(x,y):
    if x%y==0: return y
    else: return gcd(y,x%y)
n = int(input())
a = list(map(int,input().split()))
a.sort()
ans = a[0]
for i in range(1,n):
    ans = min(ans,gcd(ans,a[i]))
print(ans)