#include <bits/stdc++.h>
using namespace std;
int main() {
  long long t, a, b, c, d, tren, duoi;
  cin >> t;
  while (t--) {
    cin >> a >> b >> c;
    long long x[5];
    x[1] = a + b - c;
    x[2] = a + c - b;
    x[3] = b + c - a;
    sort(x + 1, x + 3 + 1);
    cout << abs(x[1]) + 1 << "\n";
  }
  return 0;
}
