#include <bits/stdc++.h>
using namespace std;
long long a[100005], b[100005], c[100005], sum[100005];
int n;
bool can(long long mid, bool ppp = false) {
  for (int r = 0; r < 2; r++) {
    long long amin = -4e18;
    long long amax = 4e18;
    long long bmin = -4e18;
    long long bmax = 4e18;
    long long cmin = -4e18;
    long long cmax = 4e18;
    long long smin = -4e18;
    long long smax = 4e18;
    for (int i = 0; i < (int)(n); i++) {
      amin = max(amin, -mid + a[i] - r);
      amax = min(amax, mid + a[i] - r);
      bmin = max(bmin, -mid + b[i] - r);
      bmax = min(bmax, mid + b[i] - r);
      cmin = max(cmin, -mid + c[i] - r);
      cmax = min(cmax, mid + c[i] - r);
      smin = max(smin, -mid + sum[i] - 3 * r);
      smax = min(smax, mid + sum[i] - 3 * r);
    }
    if (amin % 2 != 0) {
      amin++;
    }
    if (bmin % 2 != 0) {
      bmin++;
    }
    if (cmin % 2 != 0) {
      cmin++;
    }
    if (smin % 2 != 0) {
      smin++;
    }
    if (amax % 2 != 0) {
      amax--;
    }
    if (bmax % 2 != 0) {
      bmax--;
    }
    if (cmax % 2 != 0) {
      cmax--;
    }
    if (smax % 2 != 0) {
      smax--;
    }
    amin /= 2;
    bmin /= 2;
    cmin /= 2;
    smin /= 2;
    amax /= 2;
    bmax /= 2;
    cmax /= 2;
    smax /= 2;
    if (amin <= amax && bmin <= bmax && cmin <= cmax && smin <= smax) {
      long long least = amin + bmin + cmin;
      long long unleast = amax + bmax + cmax;
      if (unleast < smin || least > smax) {
      } else {
        if (ppp) {
          if (least >= smin) {
            long long x = bmin + cmin + r;
            long long y = amin + cmin + r;
            long long z = amin + bmin + r;
            printf("%I64d %I64d %I64d\n", x, y, z);
          } else {
            long long aa = amin;
            if (aa < smin - bmax - cmax) {
              aa = smin - bmax - cmax;
            }
            long long bb = bmin;
            if (bb < smin - aa - cmax) {
              bb = smin - aa - cmax;
            }
            long long cc = smin - aa - bb;
            long long x = bb + cc + r;
            long long y = aa + cc + r;
            long long z = aa + bb + r;
            printf("%I64d %I64d %I64d\n", x, y, z);
          }
        }
        return true;
      }
    }
  }
  return false;
}
void solve() {
  int t;
  scanf("%d", &t);
  while (t--) {
    scanf("%d", &n);
    for (int i = 0; i < (int)(n); i++) {
      long long x, y, z;
      scanf("%I64d %I64d %I64d", &x, &y, &z);
      a[i] = -x + y + z;
      b[i] = x - y + z;
      c[i] = x + y - z;
      sum[i] = x + y + z;
    }
    long long low = 0;
    long long high = 4e18;
    long long ans;
    while (low <= high) {
      long long mid = low + (high - low) / 2;
      if (can(mid)) {
        ans = mid;
        high = mid - 1;
      } else {
        low = mid + 1;
      }
    }
    can(ans, true);
  }
}
int main() {
  int TC = 1;
  for (int ZZ = 1; ZZ <= TC; ZZ++) {
    solve();
  }
  return 0;
}
