#include <bits/stdc++.h>
using namespace std;
long long a[5];
int main() {
  int t;
  scanf("%d", &t);
  while (t--) {
    scanf("%d%d%d", a, a + 1, a + 2);
    sort(a, a + 3);
    long long minn = a[2] - a[0] - a[1];
    long long maxn = a[0] + a[1] + a[2];
    if (minn > 0)
      minn = minn + 1;
    else
      minn = 1;
    for (long long i = minn; i < maxn; i++) {
      printf("%lld\n", i);
      break;
    }
  }
  return 0;
}
