z=[] n=int(input()) for i in range(n): l=[] s=input() l=s.split() z.append(int(l[0])+int(l[1])-int(l[2])) for i in z: print(i)