n = int(eval(input()))

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

maxabs = 0



for i in range(n):

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

    c = abs(a[i] - a[j])

    maxabs = max(maxabs,c)

    

print(maxabs)

n = int(eval(input()))

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



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

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

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