#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #define oo 1e9 #define tr(c, it) for(typeof((c).begin()) it = (c).begin(); it != (c).end(); it++) #define fi first #define se second #define pb push_back #define sz size #define ll long long #define all(c) c.begin(), c.end() #define PRE(i, m, n) for(int (i)=(m);(i)<(n);++(i)) #define present(container, element) (container.find(element) != container.end()) #define cpresent(container, element) (find(all(container), element) != container.end()) #define FOR(i,n) for(int (i)=0;(i)<(n);++(i)) using namespace std; typedef pair II; typedef vector VI; typedef vector VII; typedef vector VVI; typedef vector VVII; int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); int t; cin >> t; FOR(i, t) { int b, s, c; cin >> b >> s >> c; cout << b + s - c << endl; } return 0; }