#include <bits/stdc++.h>
using namespace std;
long long INF = 3e18 + 7;
long long mod = 1e9 + 7;
long long dx[4] = {1, 0, -1, 0};
long long dy[4] = {0, 1, 0, -1};
long double pi = 3.141592653589793238;
signed main() {
  long long t;
  cin >> t;
  while (t--) {
    long long a, b, c;
    cin >> a >> b >> c;
    cout << a + b + c - 1 << endl;
  }
}
