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

while True:
    m = min(a)
    for i in range(len(a)):
        if a[i] != m:
            a[i] = a[i] % m
    a.sort()
    z = a.count(0)
    a = a[z:]
    if min(a) == m:
        break
print(m) 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 while True:
    m = min(a)
    for i in range(len(a)):
        if a[i] != m:
            a[i] = a[i] % m
    a.sort()
    z = a.count(0)
    a = a[z:]
    if min(a) == m:
        break True m = min(a) m min(a) min a for i in range(len(a)):
        if a[i] != m:
            a[i] = a[i] % m
     i range(len(a)) range len(a) len a if a[i] != m:
            a[i] = a[i] % m
     a[i] != m a[i] a i m a[i] = a[i] % m a[i] a i a[i] % m a[i] a i m a.sort() a.sort a sort z = a.count(0) z a.count(0) a.count a count 0 a = a[z:] a a[z:] a z: z if min(a) == m:
        break min(a) == m min(a) min a m break print(m) print m n = int(input()) int(input()) n m = min(a) min(a) m z = a.count(0) a.count(0) z a = a[z:] a[z:] a a = list(map(int, input().split())) list(map(int, input().split())) a
n = int(input())
a = list(map(int, input().split()))

while True:
    m = min(a)
    for i in range(len(a)):
        if a[i] != m:
            a[i] = a[i] % m
    a.sort()
    z = a.count(0)
    a = a[z:]
    if min(a) == m:
        break
print(m)
