eval(input());*a,=list(map(int,input().split()));print((max(a)-min(a)))
_,a=open(0);*a,=list(map(int,a.split()));print((max(a)-min(a)))
eval(input())
(*a,) = list(map(int, input().split()))
print((max(a) - min(a)))

_, a = open(0)
(*a,) = list(map(int, a.split()))
print((max(a) - min(a)))

-eval(input()) -(*a,) = list(map(int, input().split())) +_, a = open(0) +(*a,) = list(map(int, a.split()))