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