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

if (B-A)%2==0 and (C-B)%2==0:

    cnt = (B-A)//2+C-B

elif (B-A)%2==0 and (C-B)%2==1:

    cnt = (B-A)//2+C-B

elif (B-A)%2==1 and (C-B)%2==0:

    cnt = 1+(B+1-A)//2+C-B

else:

    cnt = (B+1-A)//2+C+1-B

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

cnt = 0

cnt += C-B

A += (C-B)

if (C-A)%2==1:

    cnt += 1

    C += 1

cnt += (C-A)//2

print(cnt)
A, B, C = sorted(list(map(int, input().split())))
if (B - A) % 2 == 0 and (C - B) % 2 == 0:
    cnt = (B - A) // 2 + C - B
elif (B - A) % 2 == 0 and (C - B) % 2 == 1:
    cnt = (B - A) // 2 + C - B
elif (B - A) % 2 == 1 and (C - B) % 2 == 0:
    cnt = 1 + (B + 1 - A) // 2 + C - B
else:
    cnt = (B + 1 - A) // 2 + C + 1 - B
print(cnt)

A, B, C = sorted(list(map(int, input().split())))
cnt = 0
cnt += C - B
A += C - B
if (C - A) % 2 == 1:
    cnt += 1
    C += 1
cnt += (C - A) // 2
print(cnt)

-if (B - A) % 2 == 0 and (C - B) % 2 == 0: -    cnt = (B - A) // 2 + C - B -elif (B - A) % 2 == 0 and (C - B) % 2 == 1: -    cnt = (B - A) // 2 + C - B -elif (B - A) % 2 == 1 and (C - B) % 2 == 0: -    cnt = 1 + (B + 1 - A) // 2 + C - B -else: -    cnt = (B + 1 - A) // 2 + C + 1 - B +cnt = 0 +cnt += C - B +A += C - B +if (C - A) % 2 == 1: +    cnt += 1 +    C += 1 +cnt += (C - A) // 2