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



M = max(A, B, C)



if M % 2 == (A + B + C) % 2:

    X = M

else:

    X = M + 1



ans = (3 * X - (A + B + C)) // 2

print(ans)

ABC = list(map(int, input().split()))



sm = sum(ABC)

mx = max(ABC)



if (mx * 3) % 2 == sm % 2:

    ans = (mx * 3 - sm) // 2

else:

    ans = ((mx + 1) * 3 - sm) // 2



print(ans)

A, B, C = list(map(int, input().split()))
M = max(A, B, C)
if M % 2 == (A + B + C) % 2:
    X = M
else:
    X = M + 1
ans = (3 * X - (A + B + C)) // 2
print(ans)

ABC = list(map(int, input().split()))
sm = sum(ABC)
mx = max(ABC)
if (mx * 3) % 2 == sm % 2:
    ans = (mx * 3 - sm) // 2
else:
    ans = ((mx + 1) * 3 - sm) // 2
print(ans)

-A, B, C = list(map(int, input().split())) -M = max(A, B, C) -if M % 2 == (A + B + C) % 2: -    X = M +ABC = list(map(int, input().split())) +sm = sum(ABC) +mx = max(ABC) +if (mx * 3) % 2 == sm % 2: +    ans = (mx * 3 - sm) // 2 -    X = M + 1 -ans = (3 * X - (A + B + C)) // 2 +    ans = ((mx + 1) * 3 - sm) // 2