#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int t;
  cin >> t;
  while (t--) {
    long long int a[3];
    for (long long int i = 0; i < 3; i++) {
      cin >> a[i];
    }
    sort(a, a + 3);
    long long int sum = 0;
    sum = a[0] + a[1] + a[2];
    cout << sum - a[0] << "\n";
  }
  return 0;
}
