#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  while (t--) {
    int a, b, c;
    cin >> a >> b >> c;
    int temp1 = min(a, min(b, c)), temp2 = max(a, max(b, c));
    cout << temp1 + temp2 << endl;
  }
}
