N = int(eval(input()))

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

p =[]

for i in range(N):

    for j in range(N):

        p.append(abs(a[i]-a[j]))

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

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

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

n = int(eval(input()))
a = sorted(map(int, input().split()))
print((a[-1] - a[0]))

-N = int(eval(input())) -a = list(map(int, input().split())) -p = [] -for i in range(N): -    for j in range(N): -        p.append(abs(a[i] - a[j])) -print((max(p))) +n = int(eval(input())) +a = sorted(map(int, input().split())) +print((a[-1] - a[0]))