#include <bits/stdc++.h>
using namespace std;
const double PI = 4 * atan(1);
int T, N;
long long X[100013], Y[100013], Z[100013];
long long ansx, ansy, ansz;
inline bool is(long long x, int p) { return (((x % 2) + 2) % 2) == p; }
bool go(long long d) {
  long long xmi = -8.1e18, xma = 8.1e18, ymi = -8.1e18, yma = 8.1e18,
            zmi = -8.1e18, zma = 8.1e18, smi = -8.1e18, sma = 8.1e18;
  for (int i = 0; i < N; i++) {
    xmi = max(xmi, Y[i] + Z[i] - X[i] - d);
    xma = min(xma, Y[i] + Z[i] - X[i] + d);
    ymi = max(ymi, -Y[i] + Z[i] + X[i] - d);
    yma = min(yma, -Y[i] + Z[i] + X[i] + d);
    zmi = max(zmi, Y[i] - Z[i] + X[i] - d);
    zma = min(zma, Y[i] - Z[i] + X[i] + d);
    smi = max(smi, Y[i] + Z[i] + X[i] - d);
    sma = min(sma, Y[i] + Z[i] + X[i] + d);
  }
  for (int p = 0; p < 2; p++) {
    long long xmi2 = xmi + is(xmi, !p);
    long long ymi2 = ymi + is(ymi, !p);
    long long zmi2 = zmi + is(zmi, !p);
    long long xma2 = xma - is(xma, !p);
    long long yma2 = yma - is(yma, !p);
    long long zma2 = zma - is(zma, !p);
    long long smi2 = smi + is(smi, !p);
    long long sma2 = sma - is(sma, !p);
    if (smi2 > sma2 || xmi2 > xma2 || ymi2 > yma2 || zmi2 > zma2) continue;
    long long qmi = xmi2 + ymi2 + zmi2, qma = xma2 + yma2 + zma2;
    if (qmi <= sma2 && qma >= smi2) {
      if (xma2 + ymi2 + zmi2 < smi2) {
        if (xma2 + yma2 + zmi2 < smi2) {
          ansx = xma2;
          ansy = yma2;
          ansz = smi2 - ansx - ansy;
        } else {
          ansx = xma2;
          ansz = zmi2;
          ansy = smi2 - ansx - ansz;
        }
      } else {
        ansy = ymi2;
        ansz = zmi2;
        ansx = max(xmi2, smi2 - ansy - ansz);
      }
      return true;
    }
  }
  return false;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cin >> T;
  while (T--) {
    cin >> N;
    for (int i = 0; i < N; i++) {
      cin >> X[i] >> Y[i] >> Z[i];
    }
    long long lo = 0;
    long long hi = 3.1e18;
    while (lo != hi) {
      long long mid = (lo + hi) / 2;
      if (go(mid)) {
        hi = mid;
      } else {
        lo = mid + 1;
      }
    }
    go(lo);
    cout << (ansy + ansz) / 2 << ' ' << (ansx + ansz) / 2 << ' '
         << (ansx + ansy) / 2 << '\n';
  }
  cout.flush();
  return 0;
}
