#include <bits/stdc++.h>
using namespace std;
const long double PI = acos(-1);
template <typename T, typename U>
static inline void amin(T &x, U y) {
  if (y < x) x = y;
}
template <typename T, typename U>
static inline void amax(T &x, U y) {
  if (x < y) x = y;
}
long long gcd(long long a, long long b) {
  if (b == 0)
    return (a);
  else
    return (gcd(b, a % b));
}
int _destroyer_() {
  long long a, b, c;
  cin >> a >> b >> c;
  long long sum = a + b + c;
  cout << --sum << "\n";
  return 0;
}
signed main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int TESTS = 1;
  cin >> TESTS;
  while (TESTS--) _destroyer_();
  return 0;
}
