#include <bits/stdc++.h>
using namespace std;
int main() {
  int tt;
  scanf("%d", &tt);
  while (tt--) {
    vector<long long> a(3);
    for (int i = 0; i < 3; ++i) {
      scanf("%lld", &a[i]);
    }
    sort((a).begin(), (a).end());
    printf("%lld\n", a[2] + 1);
  }
}
