#include <bits/stdc++.h>
using namespace std;
set<long long int>::iterator itr;
map<char, long long int>::iterator itm;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long int t;
  cin >> t;
  while (t--) {
    long long int n, m, l, r, i, j, k, ans = 0;
    long long int x, y, z, c1 = 0, c2 = 0, c3 = 0, c4 = 0, sum = 0, c0 = 0;
    long long int flag = 0, ind = -1, ind2 = -1, ind3 = -1;
    long long int a, b, c, d;
    cin >> a >> b >> c;
    d = a + b + c - 1;
    cout << d << "\n";
  }
}
