#include <bits/stdc++.h>
using namespace std;
int read() {
  int s = 0, w = 1;
  char ch = getchar();
  while (ch < '0' || ch > '9') {
    if (ch == '-') w = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9')
    s = (s << 3) + (s << 1) + (ch ^ 48), ch = getchar();
  return s * w;
}
signed main() {
  int T = read(), A, B, C;
  while (T--) {
    long long A = read(), B = read(), C = read();
    printf("%lld\n", A + B + C - 1);
  }
  return 0;
}
