N = int(eval(input()))

ans = 0

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

for i in range(N):

    for j in range(N):

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

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

ans = 0

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

for i in range(N):

    for j in range(i,N,):

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

print(ans)
N = int(eval(input()))
ans = 0
A = list(map(int, input().split()))
for i in range(N):
    for j in range(N):
        ans = max(ans, abs(A[i] - A[j]))
print(ans)

N = int(eval(input()))
ans = 0
A = list(map(int, input().split()))
for i in range(N):
    for j in range(
        i,
        N,
    ):
        ans = max(ans, abs(A[i] - A[j]))
print(ans)

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