f=lambda x,y,z:abs(y-x)+abs(z-y)

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

print((min(f(a,b,c),f(a,c,b),f(b,a,c),f(b,c,a),f(c,a,b),f(c,b,a))))
m,_,M=sorted(map(int,input().split()))

print((M-m))
f = lambda x, y, z: abs(y - x) + abs(z - y)
a, b, c = list(map(int, input().split()))
print((min(f(a, b, c), f(a, c, b), f(b, a, c), f(b, c, a), f(c, a, b), f(c, b, a))))

m, _, M = sorted(map(int, input().split()))
print((M - m))

-f = lambda x, y, z: abs(y - x) + abs(z - y) -a, b, c = list(map(int, input().split())) -print((min(f(a, b, c), f(a, c, b), f(b, a, c), f(b, c, a), f(c, a, b), f(c, b, a)))) +m, _, M = sorted(map(int, input().split())) +print((M - m))