n=int(eval(input()))

a=[int(_) for _ in input().split()]

ans = 0

for i in range(1,n):

    for j in range(i):

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

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

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

print((max(a)-min(a)))
n = int(eval(input()))
a = [int(_) for _ in input().split()]
ans = 0
for i in range(1, n):
    for j in range(i):
        ans = max(ans, abs(a[i] - a[j]))
print(ans)

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

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