n = int(eval(input()))

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

ma = 0

for i in range(n):

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

        ma = max(ma, abs(a[i] - a[j]))

print(ma)

n = int(eval(input()))

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

a.sort()

print((abs(a[0] - a[-1])))

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

n = int(eval(input()))
a = list(map(int, input().split()))
a.sort()
print((abs(a[0] - a[-1])))

-ma = 0 -for i in range(n): -    for j in range(i + 1, n): -        ma = max(ma, abs(a[i] - a[j])) -print(ma) +a.sort() +print((abs(a[0] - a[-1])))