#include <bits/stdc++.h>
using namespace std;
long long f(long long x) {
  long long res;
  res = x * x;
  return res;
}
void solve() {
  long long a[3];
  cin >> a[0] >> a[1] >> a[2];
  sort(a, a + 3);
  long long d;
  d = (long long)(sqrt(f(a[2]) + f(a[1] - a[0])));
  d = d + 1;
  cout << d << '\n';
}
int main() {
  long long t;
  cin >> t;
  while (t--) solve();
}
