N = int(eval(input()))

As = [int(i) for i in input().split()]



m = -1

for i in range(N-1):

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

        m = max(abs(As[i] - As[j]), m)

print(m)

N = int(eval(input()))

As = [int(i) for i in input().split()]



# m = -1

# for i in range(N-1):

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

#         m = max(abs(As[i] - As[j]), m)

# print(m)



print((max(As) - min(As)))

N = int(eval(input()))
As = [int(i) for i in input().split()]
m = -1
for i in range(N - 1):
    for j in range(i + 1, N):
        m = max(abs(As[i] - As[j]), m)
print(m)

N = int(eval(input()))
As = [int(i) for i in input().split()]
# m = -1
# for i in range(N-1):
#     for j in range(i+1, N):
#         m = max(abs(As[i] - As[j]), m)
# print(m)
print((max(As) - min(As)))

-m = -1 -for i in range(N - 1): -    for j in range(i + 1, N): -        m = max(abs(As[i] - As[j]), m) -print(m) +# m = -1 +# for i in range(N-1): +#     for j in range(i+1, N): +#         m = max(abs(As[i] - As[j]), m) +# print(m) +print((max(As) - min(As)))