N = int(input())
A = list(map(int,input().split()))
m = min(A)
n = 0
while m != n:
    m = min(A)
    a = [m]
    for i in A:
        i %= m
        if i != 0:
            a.append(i)
    A = a
    n = min(A)
print(n) 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 m = min(A) m min(A) min A n = 0 n 0 while m != n:
    m = min(A)
    a = [m]
    for i in A:
        i %= m
        if i != 0:
            a.append(i)
    A = a
    n = min(A) m != n m n m = min(A) m min(A) min A a = [m] a [m] m for i in A:
        i %= m
        if i != 0:
            a.append(i)
     i A i %= m i m if i != 0:
            a.append(i)
     i != 0 i 0 a.append(i) a.append a append i A = a A a n = min(A) n min(A) min A print(n) print n N = int(input()) int(input()) N n = 0 0 n A = a a A A = list(map(int,input().split())) list(map(int,input().split())) A m = min(A) min(A) m i %= m m i a = [m] [m] a m = min(A) min(A) m n = min(A) min(A) n
N = int(input())
A = list(map(int,input().split()))
m = min(A)
n = 0
while m != n:
    m = min(A)
    a = [m]
    for i in A:
        i %= m
        if i != 0:
            a.append(i)
    A = a
    n = min(A)
print(n)