#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  int a, b, c;
  scanf("%d", &t);
  while (t--) {
    scanf("%d %d %d", &a, &b, &c);
    int ans = max(a, max(b, c)) + 1;
    cout << ans << endl;
  }
}
