t=int(input()) for i in range(t): x,y,xy=map(int,input().split()) print(x+y-xy)