# Just_Do_It ___________ICARUS__________________# for i in range(int(input())): b,s,g = map(int,input().split(' ')) print(b+s-g)