#include <bits/stdc++.h>

using namespace std;

int main() {
    int t;
    cin >> t;
    for(int a0 = 0; a0 < t; a0++){
        int b;
        int s;
        int c;
        cin >> b >> s >> c;
        int result = b+s-c;
        cout << result << endl;
    }
    return 0;
}