N=int(eval(input()))

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

ans=0

for i in range(N):

  for j in range(N):

    if abs(A[i]-A[j])>ans:

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

print(ans)

N=int(eval(input()))

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

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

N = int(eval(input()))
A = [int(i) for i in input().split()]
ans = 0
for i in range(N):
    for j in range(N):
        if abs(A[i] - A[j]) > ans:
            ans = abs(A[i] - A[j])
print(ans)

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

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