N = int(eval(input()))

A = list(map(int, input().split()))

x=0

key = min(A)

while x==0:

    for i in range(N):

        if int(A[i]%key)==0:

            A[i]=key

        else:

            A[i]=A[i]%key

            

    if min(A)==key:

        print(key)

        break

    else:

        key = min(A)
N = int(eval(input()))

List = list(map(int, input().split()))



while len(List)!=1:

    m = min(List)

    List = [e%m for e in List]

    List = [e for e in List if e>0]

    List.append(m)

    

print(m)
N = int(eval(input()))
A = list(map(int, input().split()))
x = 0
key = min(A)
while x == 0:
    for i in range(N):
        if int(A[i] % key) == 0:
            A[i] = key
        else:
            A[i] = A[i] % key
    if min(A) == key:
        print(key)
        break
    else:
        key = min(A)

N = int(eval(input()))
List = list(map(int, input().split()))
while len(List) != 1:
    m = min(List)
    List = [e % m for e in List]
    List = [e for e in List if e > 0]
    List.append(m)
print(m)

-A = list(map(int, input().split())) -x = 0 -key = min(A) -while x == 0: -    for i in range(N): -        if int(A[i] % key) == 0: -            A[i] = key -        else: -            A[i] = A[i] % key -    if min(A) == key: -        print(key) -        break -    else: -        key = min(A) +List = list(map(int, input().split())) +while len(List) != 1: +    m = min(List) +    List = [e % m for e in List] +    List = [e for e in List if e > 0] +    List.append(m) +print(m)