N = int(eval(input()))

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

list = []

for j in range(N):

    for k in range(N):

        list.append(abs(A_list[j]-A_list[k]))

print((max(list)))
N = int(eval(input()))

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

A_list.sort()

print((A_list[-1]-A_list[0]))
N = int(eval(input()))
A_list = [int(a) for a in input().split()]
list = []
for j in range(N):
    for k in range(N):
        list.append(abs(A_list[j] - A_list[k]))
print((max(list)))

N = int(eval(input()))
A_list = [int(a) for a in input().split()]
A_list.sort()
print((A_list[-1] - A_list[0]))

-list = [] -for j in range(N): -    for k in range(N): -        list.append(abs(A_list[j] - A_list[k])) -print((max(list))) +A_list.sort() +print((A_list[-1] - A_list[0]))