N = int(eval(input()))

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



max = 0



for i in range(N):

    for j in range(i+1,N):

        temp = abs(A[i]-A[j])

        if max < temp:

            max = temp

print(max)
N = int(eval(input()))

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



A.sort()

print((abs(A[0]-A[N-1])))
N = int(eval(input()))
(*A,) = list(map(int, input().split()))
max = 0
for i in range(N):
    for j in range(i + 1, N):
        temp = abs(A[i] - A[j])
        if max < temp:
            max = temp
print(max)

N = int(eval(input()))
(*A,) = list(map(int, input().split()))
A.sort()
print((abs(A[0] - A[N - 1])))

-max = 0 -for i in range(N): -    for j in range(i + 1, N): -        temp = abs(A[i] - A[j]) -        if max < temp: -            max = temp -print(max) +A.sort() +print((abs(A[0] - A[N - 1])))