n = int(eval(input()))

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



a.sort(reverse=True)



ans = 0

for i in range(n):

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

		if a[i] - a[j] > ans:

			ans = a[i] - a[j]



print(ans)

n = int(eval(input()))

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



a.sort(reverse=True)



print((a[0] - a[n-1]))

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

n = int(eval(input()))
a = list(map(int, input().split()))
a.sort(reverse=True)
print((a[0] - a[n - 1]))

-ans = 0 -for i in range(n): -    for j in range(i + 1, n): -        if a[i] - a[j] > ans: -            ans = a[i] - a[j] -print(ans) +print((a[0] - a[n - 1]))