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

if A-B<=C:

  print((C-(A-B)))

else:

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



res1 = A - B



if res1 <= C:

    trans = res1

else:

    trans = C



print((C - trans))
A, B, C = list(map(int, input().split()))
if A - B <= C:
    print((C - (A - B)))
else:
    print((0))

A, B, C = list(map(int, input().split()))
res1 = A - B
if res1 <= C:
    trans = res1
else:
    trans = C
print((C - trans))

-if A - B <= C: -    print((C - (A - B))) +res1 = A - B +if res1 <= C: +    trans = res1 -    print((0)) +    trans = C +print((C - trans))