#include using namespace std; int main() { int t,b,s,c; cin >> t; while(t--) { cin >> b >> s >> c; cout << b+s-c << endl; } return 0; }