n = int(eval(input()))

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

ma = 0



for i in range(n):

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

      ma = max(ma,abs(array[i]-array[j]))

print(ma)
n = int(eval(input()))

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

print((abs(max(array)-min(array))))
n = int(eval(input()))
array = list(map(int, input().split()))
ma = 0
for i in range(n):
    for j in range(i + 1, n):
        ma = max(ma, abs(array[i] - array[j]))
print(ma)

n = int(eval(input()))
array = list(map(int, input().split()))
print((abs(max(array) - min(array))))

-ma = 0 -for i in range(n): -    for j in range(i + 1, n): -        ma = max(ma, abs(array[i] - array[j])) -print(ma) +print((abs(max(array) - min(array))))