def profit(b,s,c): print ((b+s)-c) t=input() for i in range(t): b,s,c=map(int,raw_input().split()) profit(b,s,c)