#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 5;
const long long inf = 4e18;
int n;
long long x[N], y[N], z[N], X, Y, Z;
void cmin(long long &x, long long v) { x = x < v ? x : v; }
void cmax(long long &x, long long v) { x = x > v ? x : v; }
bool check(long long key) {
  long long mx, mxx, mxy, mxz, mn, mnx, mny, mnz;
  mx = mxx = mxy = mxz = inf;
  mn = mnx = mny = mnz = -inf;
  for (int i = 1; i <= n; ++i) {
    cmin(mx, key + x[i] + y[i] + z[i]);
    cmin(mxx, key - x[i] + y[i] + z[i]);
    cmin(mxy, key + x[i] - y[i] + z[i]);
    cmin(mxz, key + x[i] + y[i] - z[i]);
    cmax(mn, -key + x[i] + y[i] + z[i]);
    cmax(mnx, -key - x[i] + y[i] + z[i]);
    cmax(mny, -key + x[i] - y[i] + z[i]);
    cmax(mnz, -key + x[i] + y[i] - z[i]);
  }
  for (int i = 0; i < 2; ++i) {
    long long l = mn + ((mn & 1) ^ i), r = mx - ((mx & 1) ^ i);
    long long lx = mnx + ((mnx & 1) ^ i), rx = mxx - ((mxx & 1) ^ i);
    long long ly = mny + ((mny & 1) ^ i), ry = mxy - ((mxy & 1) ^ i);
    long long lz = mnz + ((mnz & 1) ^ i), rz = mxz - ((mxz & 1) ^ i);
    if (l > r || lx > rx || ly > ry || lz > rz) continue;
    long long a = lx, b = ly, c = lz;
    if (a + b + c > r) continue;
    if (a + b + c < l) a = rx < l - b - c ? rx : l - b - c;
    if (a + b + c < l) b = ry < l - a - c ? ry : l - a - c;
    if (a + b + c < l) c = rz < l - a - b ? rz : l - a - b;
    if (a + b + c < l) continue;
    return X = (b + c) / 2, Y = (a + c) / 2, Z = (a + b) / 2, 1;
  }
  return 0;
}
void solve() {
  cin >> n;
  for (int i = 1; i <= n; ++i) cin >> x[i] >> y[i] >> z[i];
  long long l = 0, r = inf;
  while (l < r) {
    long long mid = (l + r) >> 1;
    if (check(mid))
      r = mid;
    else
      l = mid + 1;
  }
  cout << X << ' ' << Y << ' ' << Z << endl;
}
int main() {
  ios::sync_with_stdio(false);
  int cas;
  cin >> cas;
  while (cas--) solve();
  return 0;
}
