N=int(eval(input()))

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

ans=0

for i in range(N):

    for j in range(N):

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

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

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

print((max(A)-min(A)))
N = int(eval(input()))
A = [int(x) for x in input().split()]
ans = 0
for i in range(N):
    for j in range(N):
        ans = max(ans, abs(A[i] - A[j]))
print(ans)

N = int(eval(input()))
A = [int(x) for x in input().split()]
print((max(A) - min(A)))

-ans = 0 -for i in range(N): -    for j in range(N): -        ans = max(ans, abs(A[i] - A[j])) -print(ans) +print((max(A) - min(A)))