n=int(eval(input()))

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

print((max(s)-min(s)))
n=int(eval(input()))

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

a=[]

for i in range(n-1):

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

    a.append(abs(s[i]-s[j]))

print((max(a)))
n = int(eval(input()))
s = [int(x) for x in input().split()]
print((max(s) - min(s)))

n = int(eval(input()))
s = [int(i) for i in input().split()]
a = []
for i in range(n - 1):
    for j in range(i + 1, n):
        a.append(abs(s[i] - s[j]))
print((max(a)))

-s = [int(x) for x in input().split()] -print((max(s) - min(s))) +s = [int(i) for i in input().split()] +a = [] +for i in range(n - 1): +    for j in range(i + 1, n): +        a.append(abs(s[i] - s[j])) +print((max(a)))