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

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

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