n = int(eval(input()))

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



max = 0

for i in range(n):

  for j in range(i):

    m = abs(list[j] - list[i])

    if (max < m):

      max = m

      

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

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



max = 0

for i in range(n):

  if i > 0:

    for j in range(i):

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

        if max1 > max:

            max = max1



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

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

-list = list(map(int, input().split())) +a = list(map(int, input().split())) -    for j in range(i): -        m = abs(list[j] - list[i]) -        if max < m: -            max = m +    if i > 0: +        for j in range(i): +            max1 = abs(a[i] - a[j]) +            if max1 > max: +                max = max1