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

D = B + C - A

print((max(0, D)))
A, B, C = list(map(int, input().split()))

print((max(0, B + C - A)))
A, B, C = list(map(int, input().split()))
D = B + C - A
print((max(0, D)))

A, B, C = list(map(int, input().split()))
print((max(0, B + C - A)))

-D = B + C - A -print((max(0, D))) +print((max(0, B + C - A)))