def get_gcd(a, b):
    if a<b:a,b=b,a
    if b == 0 :return a
    else:return get_gcd(b,a%b)

n = int(input().rstrip())
a = list(map(int,input().rstrip().split()))

gcd = a[0]
for i in range(1,n):
    gcd = get_gcd(gcd,a[i])
print(gcd) def get_gcd(a, b):
    if a<b:a,b=b,a
    if b == 0 :return a
    else:return get_gcd(b,a%b) get_gcd if a<b:a,b=b,a
     a<b a b if b == 0 :return a
    else:return get_gcd(b,a%b) b == 0 b 0 a a b b n = int(input().rstrip()) n int(input().rstrip()) int input().rstrip() ().rstrip () input rstrip a = list(map(int,input().rstrip().split())) a list(map(int,input().rstrip().split())) list map(int,input().rstrip().split()) map int input().rstrip().split() ().rstrip().split ().rstrip() ().rstrip () input rstrip split gcd = a[0] gcd a[0] a 0 for i in range(1,n):
    gcd = get_gcd(gcd,a[i]) i range(1,n) range 1 n gcd = get_gcd(gcd,a[i]) gcd get_gcd(gcd,a[i]) get_gcd gcd a[i] a i print(gcd) print gcd a = list(map(int,input().rstrip().split())) list(map(int,input().rstrip().split())) a gcd = get_gcd(gcd,a[i]) get_gcd(gcd,a[i]) gcd n = int(input().rstrip()) int(input().rstrip()) n gcd = a[0] a[0] gcd def get_gcd(a, b):
    if a<b:a,b=b,a
    if b == 0 :return a
    else:return get_gcd(b,a%b) def get_gcd(a, b):
    if a<b:a,b=b,a
    if b == 0 :return a
    else:return get_gcd(b,a%b) get_gcd
def get_gcd(a, b):
    if a<b:a,b=b,a
    if b == 0 :return a
    else:return get_gcd(b,a%b)

n = int(input().rstrip())
a = list(map(int,input().rstrip().split()))

gcd = a[0]
for i in range(1,n):
    gcd = get_gcd(gcd,a[i])
print(gcd)