n=int(input()) for i in range(n): b,s,c=map(int,input().split()) print((c-b-s)*-1)