t=int(input()) for i in range(t): b,s,c=map(int,input().split()) print(b+s-c)