N=int(eval(input()))

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

max=0



for i in range(0,N-1):

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

    if abs(A[i]-A[j])>=max:

      max=abs(A[i]-A[j])

print(max)
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()))
max = 0
for i in range(0, N - 1):
    for j in range(i + 1, N):
        if abs(A[i] - A[j]) >= max:
            max = abs(A[i] - A[j])
print(max)

N = int(eval(input()))
A = list(map(int, input().split()))
print((max(A) - min(A)))

-max = 0 -for i in range(0, N - 1): -    for j in range(i + 1, N): -        if abs(A[i] - A[j]) >= max: -            max = abs(A[i] - A[j]) -print(max) +print((max(A) - min(A)))