def gcd(x,y):
    while y>0:
        x,y = y,x%y
    return x
N = int(input())
A = list(map(int,input().split()))
cmin = A[0]
for i in range(1,N):
    cmin = gcd(cmin,A[i])
print(cmin) def gcd(x,y):
    while y>0:
        x,y = y,x%y
    return x gcd while y>0:
        x,y = y,x%y
     y>0 y 0 x,y = y,x%y x y y x%y x y return x x 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 cmin = A[0] cmin A[0] A 0 for i in range(1,N):
    cmin = gcd(cmin,A[i]) i range(1,N) range 1 N cmin = gcd(cmin,A[i]) cmin gcd(cmin,A[i]) gcd cmin A[i] A i print(cmin) print cmin N = int(input()) int(input()) N A = list(map(int,input().split())) list(map(int,input().split())) A def gcd(x,y):
    while y>0:
        x,y = y,x%y
    return x def gcd(x,y):
    while y>0:
        x,y = y,x%y
    return x gcd cmin = A[0] A[0] cmin cmin = gcd(cmin,A[i]) gcd(cmin,A[i]) cmin
def gcd(x,y):
    while y>0:
        x,y = y,x%y
    return x
N = int(input())
A = list(map(int,input().split()))
cmin = A[0]
for i in range(1,N):
    cmin = gcd(cmin,A[i])
print(cmin)