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

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

rem = a-b

print((max(0,c-rem)))

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

a, b, c = list(map(int, input().split()))
rem = a - b
print((max(0, c - rem)))

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