#include <bits/stdc++.h>
using namespace std;
long long floorSqrt(long long x) {
  if (x == 0 || x == 1) return x;
  long long i = 1, result = 1;
  while (result <= x) {
    i++;
    result = i * i;
  }
  return i - 1;
}
int main() {
  int t, n;
  cin >> t;
  while (t--) {
    long long a[3];
    long long e, r, u;
    cin >> e >> r >> u;
    a[0] = e;
    a[1] = r;
    a[2] = u;
    sort(a, a + 3);
    long long y = (a[1] * a[1]) + ((a[2] - a[0]) * (a[2] - a[0]));
    long long z = sqrtl(y);
    cout << z + 1 << "\n";
  }
}
