#include <bits/stdc++.h>
using namespace std;
int n, m, t;
int main() {
  long long a, b, c;
  cin >> t;
  while (t--) {
    cin >> a >> b >> c;
    cout << (a + b + c) - 1 << endl;
  }
  return 0;
}
