#include <bits/stdc++.h>
using namespace std;
const int mod = 1000000007;
void solve() {
  int a, b, c;
  cin >> a >> b >> c;
  int x = max(max(a, b), c);
  cout << x + 1 << "\n";
}
int main() {
  cin.tie(0);
  cout.tie(0);
  ios_base::sync_with_stdio(false);
  int y;
  cin >> y;
  while (y--) {
    solve();
  }
}
