temp=list(map(int, input().split()))

a=temp[2]-(temp[0]-temp[1])

if a>=0:

  print(a)

else:

  print((0))
temp=list(map(int, input().split()))



temp=temp[2]-(temp[0]-temp[1])



if temp<0:

  print((0))

else:

  print((int(temp)))
temp = list(map(int, input().split()))
a = temp[2] - (temp[0] - temp[1])
if a >= 0:
    print(a)
else:
    print((0))

temp = list(map(int, input().split()))
temp = temp[2] - (temp[0] - temp[1])
if temp < 0:
    print((0))
else:
    print((int(temp)))

-a = temp[2] - (temp[0] - temp[1]) -if a >= 0: -    print(a) +temp = temp[2] - (temp[0] - temp[1]) +if temp < 0: +    print((0)) -    print((0)) +    print((int(temp)))