a, b, c =sorted(map(int, input().split()), reverse=True)

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

a.sort()

print((abs(a[2]-a[1])+abs(a[1]-a[0])))

a, b, c = sorted(map(int, input().split()), reverse=True)
print(((a - b) + (b - c)))

a = list(map(int, input().split()))
a.sort()
print((abs(a[2] - a[1]) + abs(a[1] - a[0])))

-a, b, c = sorted(map(int, input().split()), reverse=True) -print(((a - b) + (b - c))) +a = list(map(int, input().split())) +a.sort() +print((abs(a[2] - a[1]) + abs(a[1] - a[0])))