#include <cmath>
#include <cstdio>
#include <vector>
#include <iostream>
#include <algorithm>
using namespace std;


int main() {
    /* Enter your code here. Read input from STDIN. Print output to STDOUT */ 
    int t, a, b, c, d;
    cin>>t;
    while(t--){
    cin>>a>>b>>c;
        d = a+b-c;
        cout<<d<<endl;
    }
    return 0;
}