n = int(eval(input()))

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

ans = 0

for i in range(n):

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

        if abs(a[i]- a[j]) > ans:

            ans = abs(a[i]- a[j])

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

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

mx = 0

for i in range(n):

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

    if mx < abs(a[i] - a[j]):

      mx = abs(a[i] - a[j])

print(mx)
n = int(eval(input()))
a = list(map(int, input().split()))
ans = 0
for i in range(n):
    for j in range(i + 1, n):
        if abs(a[i] - a[j]) > ans:
            ans = abs(a[i] - a[j])
print(ans)

n = int(eval(input()))
a = list(map(int, input().split()))
mx = 0
for i in range(n):
    for j in range(i + 1, n):
        if mx < abs(a[i] - a[j]):
            mx = abs(a[i] - a[j])
print(mx)

-ans = 0 +mx = 0 -        if abs(a[i] - a[j]) > ans: -            ans = abs(a[i] - a[j]) -print(ans) +        if mx < abs(a[i] - a[j]): +            mx = abs(a[i] - a[j]) +print(mx)