n = eval(input())

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

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

n=int(eval(input()))

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

print((max(A)-min(A)))

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

n = int(eval(input()))
A = list(map(int, input().split()))
print((max(A) - min(A)))

-n = eval(input()) -a = sorted(map(int, input().split())) -print((a[-1] - a[0])) +n = int(eval(input())) +A = list(map(int, input().split())) +print((max(A) - min(A)))