N = int(eval(input()))

A = input().split(" ")

A = [int(i) for i in A]

list = [min(A)]

A = sorted(A)

iii = 0

while True:

    iii += 1

    if A[N-1] % A[N-2] != 0:

        A[N-1] = A[N-1] % A[N-2]

    elif N >= 3 and A[N-1] % A[N-3] != 0:

        A[N-1] = A[N-1] % A[N-3]

    elif N >= 4 and A[N-1] % A[N-4] != 0:

        A[N-1] = A[N-1] % A[N-4]

    elif N >= 5 and A[N-1] % A[N-5] != 0:

        A[N-1] = A[N-1] % A[N-5]

    elif N >= 6 and A[N-1] % A[N-6] != 0:

        A[N-1] = A[N-1] % A[N-6]

    elif N >= 7 and A[N-1] % A[N-7] != 0:

        A[N-1] = A[N-1] % A[N-7]

    elif N >= 8 and A[N-1] % A[N-8] != 0:

        A[N-1] = A[N-1] % A[N-8]

    elif N >= 9 and A[N-1] % A[N-9] != 0:

        A[N-1] = A[N-1] % A[N-9]

    elif N >= 10 and A[N-1] % A[N-10] != 0:

        A[N-1] = A[N-1] % A[N-10]

    elif N >= 11 and A[N-1] % A[N-11] != 0:

        A[N-1] = A[N-1] % A[N-11]

    elif N >= 12 and A[N-1] % A[N-12] != 0:

        A[N-1] = A[N-1] % A[N-12]

    elif N >= 13 and A[N-1] % A[N-13] != 0:

        A[N-1] = A[N-1] % A[N-13]

    elif N >= 14 and A[N-1] % A[N-14] != 0:

        A[N-1] = A[N-1] % A[N-14]

    elif N >= 15 and A[N-1] % A[N-15] != 0:

        A[N-1] = A[N-1] % A[N-15]

    elif N >= 16 and A[N-1] % A[N-16] != 0:

        A[N-1] = A[N-1] % A[N-16]

    elif N >= 17 and A[N-1] % A[N-17] != 0:

        A[N-1] = A[N-1] % A[N-17]

    elif N >= 18 and A[N-1] % A[N-18] != 0:

        A[N-1] = A[N-1] % A[N-18]

    elif N >= 19 and A[N-1] % A[N-19] != 0:

        A[N-1] = A[N-1] % A[N-19]



    A = sorted(A)

    list.append(min(A))

    if iii > 128:

        break       

#print(list)

for i in range(N-1):

    if A[i+1]-A[i] > 0:

        list.append(A[i+1]-A[i])

#print(list)

print((min(list)))
N = int(eval(input()))

A = input().split(" ")

A = [int(i) for i in A]

list = [min(A)]

A = sorted(A)

iii = 0

while True:

    iii += 1

    if A[N-1] % A[N-2] != 0:

        A[N-1] = A[N-1] % A[N-2]

    elif N >= 3 and A[N-1] % A[N-3] != 0:

        A[N-1] = A[N-1] % A[N-3]

    elif N >= 4 and A[N-1] % A[N-4] != 0:

        A[N-1] = A[N-1] % A[N-4]

    elif N >= 5 and A[N-1] % A[N-5] != 0:

        A[N-1] = A[N-1] % A[N-5]

    elif N >= 6 and A[N-1] % A[N-6] != 0:

        A[N-1] = A[N-1] % A[N-6]

    elif N >= 7 and A[N-1] % A[N-7] != 0:

        A[N-1] = A[N-1] % A[N-7]

    elif N >= 8 and A[N-1] % A[N-8] != 0:

        A[N-1] = A[N-1] % A[N-8]

    elif N >= 9 and A[N-1] % A[N-9] != 0:

        A[N-1] = A[N-1] % A[N-9]

    elif N >= 10 and A[N-1] % A[N-10] != 0:

        A[N-1] = A[N-1] % A[N-10]



    A = sorted(A)

    list.append(min(A))

    if iii > 96:

        break       

#print(list)

for i in range(N-1):

    if A[i+1]-A[i] > 0:

        list.append(A[i+1]-A[i])

#print(list)

print((min(list)))
N = int(eval(input()))
A = input().split(" ")
A = [int(i) for i in A]
list = [min(A)]
A = sorted(A)
iii = 0
while True:
    iii += 1
    if A[N - 1] % A[N - 2] != 0:
        A[N - 1] = A[N - 1] % A[N - 2]
    elif N >= 3 and A[N - 1] % A[N - 3] != 0:
        A[N - 1] = A[N - 1] % A[N - 3]
    elif N >= 4 and A[N - 1] % A[N - 4] != 0:
        A[N - 1] = A[N - 1] % A[N - 4]
    elif N >= 5 and A[N - 1] % A[N - 5] != 0:
        A[N - 1] = A[N - 1] % A[N - 5]
    elif N >= 6 and A[N - 1] % A[N - 6] != 0:
        A[N - 1] = A[N - 1] % A[N - 6]
    elif N >= 7 and A[N - 1] % A[N - 7] != 0:
        A[N - 1] = A[N - 1] % A[N - 7]
    elif N >= 8 and A[N - 1] % A[N - 8] != 0:
        A[N - 1] = A[N - 1] % A[N - 8]
    elif N >= 9 and A[N - 1] % A[N - 9] != 0:
        A[N - 1] = A[N - 1] % A[N - 9]
    elif N >= 10 and A[N - 1] % A[N - 10] != 0:
        A[N - 1] = A[N - 1] % A[N - 10]
    elif N >= 11 and A[N - 1] % A[N - 11] != 0:
        A[N - 1] = A[N - 1] % A[N - 11]
    elif N >= 12 and A[N - 1] % A[N - 12] != 0:
        A[N - 1] = A[N - 1] % A[N - 12]
    elif N >= 13 and A[N - 1] % A[N - 13] != 0:
        A[N - 1] = A[N - 1] % A[N - 13]
    elif N >= 14 and A[N - 1] % A[N - 14] != 0:
        A[N - 1] = A[N - 1] % A[N - 14]
    elif N >= 15 and A[N - 1] % A[N - 15] != 0:
        A[N - 1] = A[N - 1] % A[N - 15]
    elif N >= 16 and A[N - 1] % A[N - 16] != 0:
        A[N - 1] = A[N - 1] % A[N - 16]
    elif N >= 17 and A[N - 1] % A[N - 17] != 0:
        A[N - 1] = A[N - 1] % A[N - 17]
    elif N >= 18 and A[N - 1] % A[N - 18] != 0:
        A[N - 1] = A[N - 1] % A[N - 18]
    elif N >= 19 and A[N - 1] % A[N - 19] != 0:
        A[N - 1] = A[N - 1] % A[N - 19]
    A = sorted(A)
    list.append(min(A))
    if iii > 128:
        break
# print(list)
for i in range(N - 1):
    if A[i + 1] - A[i] > 0:
        list.append(A[i + 1] - A[i])
# print(list)
print((min(list)))

N = int(eval(input()))
A = input().split(" ")
A = [int(i) for i in A]
list = [min(A)]
A = sorted(A)
iii = 0
while True:
    iii += 1
    if A[N - 1] % A[N - 2] != 0:
        A[N - 1] = A[N - 1] % A[N - 2]
    elif N >= 3 and A[N - 1] % A[N - 3] != 0:
        A[N - 1] = A[N - 1] % A[N - 3]
    elif N >= 4 and A[N - 1] % A[N - 4] != 0:
        A[N - 1] = A[N - 1] % A[N - 4]
    elif N >= 5 and A[N - 1] % A[N - 5] != 0:
        A[N - 1] = A[N - 1] % A[N - 5]
    elif N >= 6 and A[N - 1] % A[N - 6] != 0:
        A[N - 1] = A[N - 1] % A[N - 6]
    elif N >= 7 and A[N - 1] % A[N - 7] != 0:
        A[N - 1] = A[N - 1] % A[N - 7]
    elif N >= 8 and A[N - 1] % A[N - 8] != 0:
        A[N - 1] = A[N - 1] % A[N - 8]
    elif N >= 9 and A[N - 1] % A[N - 9] != 0:
        A[N - 1] = A[N - 1] % A[N - 9]
    elif N >= 10 and A[N - 1] % A[N - 10] != 0:
        A[N - 1] = A[N - 1] % A[N - 10]
    A = sorted(A)
    list.append(min(A))
    if iii > 96:
        break
# print(list)
for i in range(N - 1):
    if A[i + 1] - A[i] > 0:
        list.append(A[i + 1] - A[i])
# print(list)
print((min(list)))

-    elif N >= 11 and A[N - 1] % A[N - 11] != 0: -        A[N - 1] = A[N - 1] % A[N - 11] -    elif N >= 12 and A[N - 1] % A[N - 12] != 0: -        A[N - 1] = A[N - 1] % A[N - 12] -    elif N >= 13 and A[N - 1] % A[N - 13] != 0: -        A[N - 1] = A[N - 1] % A[N - 13] -    elif N >= 14 and A[N - 1] % A[N - 14] != 0: -        A[N - 1] = A[N - 1] % A[N - 14] -    elif N >= 15 and A[N - 1] % A[N - 15] != 0: -        A[N - 1] = A[N - 1] % A[N - 15] -    elif N >= 16 and A[N - 1] % A[N - 16] != 0: -        A[N - 1] = A[N - 1] % A[N - 16] -    elif N >= 17 and A[N - 1] % A[N - 17] != 0: -        A[N - 1] = A[N - 1] % A[N - 17] -    elif N >= 18 and A[N - 1] % A[N - 18] != 0: -        A[N - 1] = A[N - 1] % A[N - 18] -    elif N >= 19 and A[N - 1] % A[N - 19] != 0: -        A[N - 1] = A[N - 1] % A[N - 19] -    if iii > 128: +    if iii > 96: