#include <bits/stdc++.h>
using namespace std;
int a[4];
int main() {
  int t;
  cin >> t;
  for (int i = 1; i <= t; ++i) {
    for (int j = 1; j <= 3; ++j) cin >> a[j];
    sort(a + 1, a + 4);
    cout << a[3] + 1 << "\n";
  }
}
