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

def gcd(x,y):
    if y==0: return x
    return gcd(y,x%y)
ans = A[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(x,y):
    if y==0: return x
    return gcd(y,x%y) gcd if y==0: return x
     y==0 y 0 return gcd(y,x%y) gcd(y,x%y) gcd y x%y x y x x y y ans = A[0] ans A[0] A 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 def gcd(x,y):
    if y==0: return x
    return gcd(y,x%y) def gcd(x,y):
    if y==0: return x
    return gcd(y,x%y) gcd A = list(map(int,input().split())) list(map(int,input().split())) A N = int(input()) int(input()) N ans = A[0] A[0] ans ans = gcd(ans,a) gcd(ans,a) ans
N = int(input())
A = list(map(int,input().split()))

def gcd(x,y):
    if y==0: return x
    return gcd(y,x%y)
ans = A[0]
for a in A:
    ans = gcd(ans,a)
print(ans)