#include <bits/stdc++.h>
using namespace std;
void solve() {
  long long a;
  long long b;
  long long c;
  vector<long long> v(3);
  for (int i = 0; i < 3; i++) cin >> v[i];
  sort(v.begin(), v.end());
  a = v[0];
  b = v[1];
  c = v[2];
  cout << c + 1 << endl;
}
int main() {
  int t;
  cin >> t;
  while (t--) {
    solve();
  }
  return 0;
}
