n=int(eval(input()))

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

ans=0

for i in range(n):

    for j in range(n-1):

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

        ans=max(ans,temp)

print(ans)
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()))
ans = 0
for i in range(n):
    for j in range(n - 1):
        temp = abs(a[i] - a[j])
        ans = max(ans, temp)
print(ans)

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

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