def game(a,b,c):
    return a+b-c

for _ in range(int(input())):
    a,b,c=[int(x) for x in input().split()]
    print(game(a,b,c))