#!/bin/python3 t=int(input()) for i in range (0,t): l=list(map(int,input().split(" "))) sum=(l[0]+l[1])-l[2] print(sum)