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

l = a[:]
while len(l) > 1:
    midx = l.index(min(l))
    r = []
    for i in range(len(l)):
        if i != midx:
            l[i] = l[i] % l[midx]
        if l[i] != 0:
            r.append(l[i])
    l = r[:]
print(l[0]) 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 l = a[:] l a[:] a : while len(l) > 1:
    midx = l.index(min(l))
    r = []
    for i in range(len(l)):
        if i != midx:
            l[i] = l[i] % l[midx]
        if l[i] != 0:
            r.append(l[i])
    l = r[:] len(l) > 1 len(l) len l 1 midx = l.index(min(l)) midx l.index(min(l)) l.index l index min(l) min l r = [] r [] for i in range(len(l)):
        if i != midx:
            l[i] = l[i] % l[midx]
        if l[i] != 0:
            r.append(l[i])
     i range(len(l)) range len(l) len l if i != midx:
            l[i] = l[i] % l[midx]
         i != midx i midx l[i] = l[i] % l[midx] l[i] l i l[i] % l[midx] l[i] l i l[midx] l midx if l[i] != 0:
            r.append(l[i])
     l[i] != 0 l[i] l i 0 r.append(l[i]) r.append r append l[i] l i l = r[:] l r[:] r : print(l[0]) print l[0] l 0 a = list(map(int, input().split())) list(map(int, input().split())) a r = [] [] r midx = l.index(min(l)) l.index(min(l)) midx n = int(input()) int(input()) n l = a[:] a[:] l l = r[:] r[:] l
n = int(input())
a = list(map(int, input().split()))

l = a[:]
while len(l) > 1:
    midx = l.index(min(l))
    r = []
    for i in range(len(l)):
        if i != midx:
            l[i] = l[i] % l[midx]
        if l[i] != 0:
            r.append(l[i])
    l = r[:]
print(l[0])