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

mx=max((a,b,c))

sm=sum((a,b,c))

d=mx*3-sm

print(((d+3)//2 if d&1 else d//2))
A,B,C=list(map(int, input().split()))

S=max(A,B,C)*3

S+=3 if S&1!=(A+B+C)&1 else 0

print(((S-(A+B+C))//2))
a, b, c = list(map(int, input().split()))
mx = max((a, b, c))
sm = sum((a, b, c))
d = mx * 3 - sm
print(((d + 3) // 2 if d & 1 else d // 2))

A, B, C = list(map(int, input().split()))
S = max(A, B, C) * 3
S += 3 if S & 1 != (A + B + C) & 1 else 0
print(((S - (A + B + C)) // 2))

-a, b, c = list(map(int, input().split())) -mx = max((a, b, c)) -sm = sum((a, b, c)) -d = mx * 3 - sm -print(((d + 3) // 2 if d & 1 else d // 2)) +A, B, C = list(map(int, input().split())) +S = max(A, B, C) * 3 +S += 3 if S & 1 != (A + B + C) & 1 else 0 +print(((S - (A + B + C)) // 2))