A1,A2,A3=list(map(int,input().split()))

A=[A1,A2,A3]

A.append(A1)

def A_(i):

    if A[i]-A[i+1]>=0:

        return A[i]-A[i+1]

    else:

        return A[i+1]-A[i]

B=[A_(i) for i in range(3)]

B.append(A_(0))

B.append(A_(1))

def sum(j):

    return B[j]+B[j+1]

C=[sum(j) for j in range(3)]

print((min(C)))
A1,A2,A3=list(map(int,input().split()))

A_1=abs(A1-A2)+abs(A2-A3)

A_2=abs(A1-A3)+abs(A2-A3)

A_3=abs(A1-A2)+abs(A1-A3)

print((min(A_1,A_2,A_3)))
A1, A2, A3 = list(map(int, input().split()))
A = [A1, A2, A3]
A.append(A1)


def A_(i):
    if A[i] - A[i + 1] >= 0:
        return A[i] - A[i + 1]
    else:
        return A[i + 1] - A[i]


B = [A_(i) for i in range(3)]
B.append(A_(0))
B.append(A_(1))


def sum(j):
    return B[j] + B[j + 1]


C = [sum(j) for j in range(3)]
print((min(C)))

A1, A2, A3 = list(map(int, input().split()))
A_1 = abs(A1 - A2) + abs(A2 - A3)
A_2 = abs(A1 - A3) + abs(A2 - A3)
A_3 = abs(A1 - A2) + abs(A1 - A3)
print((min(A_1, A_2, A_3)))

-A = [A1, A2, A3] -A.append(A1) - - -def A_(i): -    if A[i] - A[i + 1] >= 0: -        return A[i] - A[i + 1] -    else: -        return A[i + 1] - A[i] - - -B = [A_(i) for i in range(3)] -B.append(A_(0)) -B.append(A_(1)) - - -def sum(j): -    return B[j] + B[j + 1] - - -C = [sum(j) for j in range(3)] -print((min(C))) +A_1 = abs(A1 - A2) + abs(A2 - A3) +A_2 = abs(A1 - A3) + abs(A2 - A3) +A_3 = abs(A1 - A2) + abs(A1 - A3) +print((min(A_1, A_2, A_3)))