n = int(eval(input()))

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

dmax = 0

for i in range(n-1):

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

        dmax = max(dmax, abs(A[i]-A[j]))

print(dmax)

_ = eval(input())

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

print((abs(max(A) - min(A))))

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

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

-n = int(eval(input())) +_ = eval(input()) -dmax = 0 -for i in range(n - 1): -    for j in range(i + 1, n): -        dmax = max(dmax, abs(A[i] - A[j])) -print(dmax) +print((abs(max(A) - min(A))))