N = int(eval(input()))

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



diff = 0

maxNum = 0

maxDiffArray = []

for i in range(len(L)):

    diffArray = []

    for j in range(len(L)):

        if i != j:

            diff = abs(L[i] - L[j])

            diffArray.append(diff)

    maxDiffArray.append(max(diffArray))

print((max(maxDiffArray)))

N = int(eval(input()))

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



# diff = 0

# maxNum = 0

# maxDiffArray = []

# for i in range(len(L)):

#     diffArray = []

#     for j in range(len(L)):

#         if i != j:

#             diff = abs(L[i] - L[j])

#             diffArray.append(diff)

#     maxDiffArray.append(max(diffArray))

# print(max(maxDiffArray))



# 別解：数列の最大値と最小値の差が要素間の差の最大値となることを利用

print((max(L) - min(L)))

N = int(eval(input()))
L = list(map(int, input().split()))
diff = 0
maxNum = 0
maxDiffArray = []
for i in range(len(L)):
    diffArray = []
    for j in range(len(L)):
        if i != j:
            diff = abs(L[i] - L[j])
            diffArray.append(diff)
    maxDiffArray.append(max(diffArray))
print((max(maxDiffArray)))

N = int(eval(input()))
L = list(map(int, input().split()))
# diff = 0
# maxNum = 0
# maxDiffArray = []
# for i in range(len(L)):
#     diffArray = []
#     for j in range(len(L)):
#         if i != j:
#             diff = abs(L[i] - L[j])
#             diffArray.append(diff)
#     maxDiffArray.append(max(diffArray))
# print(max(maxDiffArray))
# 別解：数列の最大値と最小値の差が要素間の差の最大値となることを利用
print((max(L) - min(L)))

-diff = 0 -maxNum = 0 -maxDiffArray = [] -for i in range(len(L)): -    diffArray = [] -    for j in range(len(L)): -        if i != j: -            diff = abs(L[i] - L[j]) -            diffArray.append(diff) -    maxDiffArray.append(max(diffArray)) -print((max(maxDiffArray))) +# diff = 0 +# maxNum = 0 +# maxDiffArray = [] +# for i in range(len(L)): +#     diffArray = [] +#     for j in range(len(L)): +#         if i != j: +#             diff = abs(L[i] - L[j]) +#             diffArray.append(diff) +#     maxDiffArray.append(max(diffArray)) +# print(max(maxDiffArray)) +# 別解：数列の最大値と最小値の差が要素間の差の最大値となることを利用 +print((max(L) - min(L)))