N = int(eval(input()))

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

ans = 0



from itertools import combinations



for i, j in combinations(A, 2):

    ans = max(ans, abs(i - j))



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

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



A = sorted(A)

print((A[-1] - A[0]))
N = int(eval(input()))
A = list(map(int, input().split()))
ans = 0
from itertools import combinations

for i, j in combinations(A, 2):
    ans = max(ans, abs(i - j))
print(ans)

N = int(eval(input()))
A = list(map(int, input().split()))
A = sorted(A)
print((A[-1] - A[0]))

-ans = 0 -from itertools import combinations - -for i, j in combinations(A, 2): -    ans = max(ans, abs(i - j)) -print(ans) +A = sorted(A) +print((A[-1] - A[0]))