#include <bits/stdc++.h>
using namespace std;
inline long long z_beg(long long x) { return __builtin_clz(x); }
inline long long z_end(long long x) { return __builtin_ctz(x); }
inline long long c_one(long long x) { return __builtin_popcount(x); }
inline long long parity_one(long long x) { return __builtin_parity(x); }
constexpr int bits(int x) { return 31 - __builtin_clz(x); }
const int MOD = (int)1e9 + 7;
const int FFTMOD = 1007681537;
const int INF = (int)1e9;
const long long LINF = (long long)1e18;
const long double PI = acos((long double)-1);
const long double EPS = 1e-9;
unsigned long long power(unsigned long long x, long long y, long long p) {
  unsigned long long res = 1;
  x = x % p;
  while (y > 0) {
    if (y & 1) res = (res * x) % p;
    y = y >> 1;
    x = (x * x) % p;
  }
  return res;
}
unsigned long long modInverse(unsigned long long n, long long p) {
  return power(n, p - 2, p);
}
unsigned long long nCrModPFermat(unsigned long long n, long long r,
                                 long long p) {
  if (n < r) return 0;
  if (r == 0) return 1;
  unsigned long long fac[n + 1];
  fac[0] = 1;
  for (int i = 1; i <= n; i++) fac[i] = (fac[i - 1] * i) % p;
  return (fac[n] * modInverse(fac[r], p) % p * modInverse(fac[n - r], p) % p) %
         p;
}
inline long long gcd(long long a, long long b) {
  return (b ? gcd(b, a % b) : a);
}
inline long long lcm(long long a, long long b) { return a / gcd(a, b) * b; }
bool isPrime(long long n) {
  if (n <= 1LL) return false;
  if (n <= 3LL) return true;
  if (n % 2 == 0LL || n % 3 == 0LL) return false;
  for (long long i = 5LL; (i * i) <= n; i += 6LL)
    if (n % i == 0LL || n % (i + 2LL) == 0LL) return false;
  return true;
}
void __printing_a_print(int x) { cerr << x; }
void __printing_a_print(long x) { cerr << x; }
void __printing_a_print(long long x) { cerr << x; }
void __printing_a_print(unsigned x) { cerr << x; }
void __printing_a_print(unsigned long x) { cerr << x; }
void __printing_a_print(unsigned long long x) { cerr << x; }
void __printing_a_print(float x) { cerr << x; }
void __printing_a_print(double x) { cerr << x; }
void __printing_a_print(long double x) { cerr << x; }
void __printing_a_print(char x) { cerr << '\'' << x << '\''; }
void __printing_a_print(const char* x) { cerr << '\"' << x << '\"'; }
void __printing_a_print(const string& x) { cerr << '\"' << x << '\"'; }
void __printing_a_print(bool x) { cerr << (x ? "true" : "false"); }
template <typename T, typename V>
void __printing_a_print(const pair<T, V>& x) {
  cerr << '{';
  __printing_a_print(x.first);
  cerr << ',';
  __printing_a_print(x.second);
  cerr << '}';
}
template <typename T>
void __printing_a_print(const T& x) {
  int f = 0;
  cerr << '{';
  for (auto& i : x) cerr << (f++ ? "," : ""), __printing_a_print(i);
  cerr << "}";
}
void _printing_a_print() { cerr << "]\n"; }
template <typename T, typename... V>
void _printing_a_print(T t, V... v) {
  __printing_a_print(t);
  if (sizeof...(v)) cerr << ", ";
  _printing_a_print(v...);
}
void io() {}
void solve(void);
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout << setprecision(20);
  io();
  long long t = 1;
  cin >> t;
  while (t--) solve();
  return 0;
}
void solve() {
  vector<long long> arr(3);
  for (auto& x : arr) cin >> x;
  ;
  long long mx = INT_MIN;
  for (long long i = 0; i < 3; i++) {
    mx = max(mx, arr[i]);
  }
  cout << mx + 1 << "\n";
}
