n = int(eval(input()))

l = [int(i) for i in input().split()]



m = []

flag = 0

while flag ==0:

    l.sort()

    p = len(l)

    for i in range(1,p):

        a = l[i]%l[0]

        if a != 0:

            l[i] = a

        else:

            l[i] = l[0]



    kkk = set(l)

    if len(kkk) <= 1 or min(l) == 1:

        flag = 1



if len(l) == 0:

    print((l[0]))

else:

    l.sort()

    print((l[0]))

N = int(eval(input()))

A = [int(i) for i in input().split()]



b = min(A)

for a in A:

    while True:

        if a%b == 0:

            break

        tb = b

        b = a%b

        a = tb



print(b)

n = int(eval(input()))
l = [int(i) for i in input().split()]
m = []
flag = 0
while flag == 0:
    l.sort()
    p = len(l)
    for i in range(1, p):
        a = l[i] % l[0]
        if a != 0:
            l[i] = a
        else:
            l[i] = l[0]
    kkk = set(l)
    if len(kkk) <= 1 or min(l) == 1:
        flag = 1
if len(l) == 0:
    print((l[0]))
else:
    l.sort()
    print((l[0]))

N = int(eval(input()))
A = [int(i) for i in input().split()]
b = min(A)
for a in A:
    while True:
        if a % b == 0:
            break
        tb = b
        b = a % b
        a = tb
print(b)

-n = int(eval(input())) -l = [int(i) for i in input().split()] -m = [] -flag = 0 -while flag == 0: -    l.sort() -    p = len(l) -    for i in range(1, p): -        a = l[i] % l[0] -        if a != 0: -            l[i] = a -        else: -            l[i] = l[0] -    kkk = set(l) -    if len(kkk) <= 1 or min(l) == 1: -        flag = 1 -if len(l) == 0: -    print((l[0])) -else: -    l.sort() -    print((l[0])) +N = int(eval(input())) +A = [int(i) for i in input().split()] +b = min(A) +for a in A: +    while True: +        if a % b == 0: +            break +        tb = b +        b = a % b +        a = tb +print(b)