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



C -= A-B

if C < 0:

    C = 0



print(C)

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



d = min(A-B, C)

print((C-d))

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

A, B, C = list(map(int, input().split()))
d = min(A - B, C)
print((C - d))

-C -= A - B -if C < 0: -    C = 0 -print(C) +d = min(A - B, C) +print((C - d))