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

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

water=C-(A-B)

print((water if water>0 else 0))
A, B, C = list(map(int, input().split()))
print((max(0, C - (A - B))))

A, B, C = list(map(int, input().split()))
water = C - (A - B)
print((water if water > 0 else 0))

-print((max(0, C - (A - B)))) +water = C - (A - B) +print((water if water > 0 else 0))