A,B,C=list(map(int, input().split()))

L=sorted([A,B,C])

ans=(L[2]-L[1]+L[2]-L[0])//2+((L[2]-L[1]+L[2]-L[0])%2)*2

print(ans)
from math import ceil

A,B,C=list(map(int, input().split()))

L=sorted([A,B,C])

n1=L[0]

n2=L[1]

n3=L[2]



fir=ceil((n2-n1)/2)

if n1+2*fir!=n2:

    sec=1

else:

    sec=0



ans=n3+sec-(n1+2*fir)+fir+sec

print(ans)

#print(fir, sec)

#6+1-(4)
A, B, C = list(map(int, input().split()))
L = sorted([A, B, C])
ans = (L[2] - L[1] + L[2] - L[0]) // 2 + ((L[2] - L[1] + L[2] - L[0]) % 2) * 2
print(ans)

from math import ceil

A, B, C = list(map(int, input().split()))
L = sorted([A, B, C])
n1 = L[0]
n2 = L[1]
n3 = L[2]
fir = ceil((n2 - n1) / 2)
if n1 + 2 * fir != n2:
    sec = 1
else:
    sec = 0
ans = n3 + sec - (n1 + 2 * fir) + fir + sec
print(ans)
# print(fir, sec)
# 6+1-(4)

+from math import ceil + -ans = (L[2] - L[1] + L[2] - L[0]) // 2 + ((L[2] - L[1] + L[2] - L[0]) % 2) * 2 +n1 = L[0] +n2 = L[1] +n3 = L[2] +fir = ceil((n2 - n1) / 2) +if n1 + 2 * fir != n2: +    sec = 1 +else: +    sec = 0 +ans = n3 + sec - (n1 + 2 * fir) + fir + sec +# print(fir, sec) +# 6+1-(4)