#include <bits/stdc++.h>
using namespace std;
long long gcd(long long a, long long b) { return b == 0 ? a : gcd(b, a % b); }
const int MAXN = 100000;
typedef struct P {
  long long x, y, z;
} P;
int n;
P p[MAXN];
long long x, y, z;
long long divdn(long long p, long long q) {
  return p >= 0 ? p / q : (p - q + 1) / q;
}
long long divup(long long p, long long q) {
  return p >= 0 ? (p + q - 1) / q : p / q;
}
bool ok(long long D) {
  long long sl = LLONG_MIN, su = LLONG_MAX;
  long long al = LLONG_MIN, au = LLONG_MAX;
  long long bl = LLONG_MIN, bu = LLONG_MAX;
  long long cl = LLONG_MIN, cu = LLONG_MAX;
  for (int i = (0); i < (n); ++i) {
    sl = max(sl, -D + p[i].x + p[i].y + p[i].z);
    al = max(al, -D - p[i].x + p[i].y + p[i].z);
    bl = max(bl, -D + p[i].x - p[i].y + p[i].z);
    cl = max(cl, -D + p[i].x + p[i].y - p[i].z);
    su = min(su, +D + p[i].x + p[i].y + p[i].z);
    au = min(au, +D - p[i].x + p[i].y + p[i].z);
    bu = min(bu, +D + p[i].x - p[i].y + p[i].z);
    cu = min(cu, +D + p[i].x + p[i].y - p[i].z);
  }
  for (int par = (0); par < (2); ++par) {
    long long SL = divup(sl - 3 * par, 2), SU = divdn(su - 3 * par, 2);
    long long AL = divup(al - par, 2), AU = divdn(au - par, 2);
    long long BL = divup(bl - par, 2), BU = divdn(bu - par, 2);
    long long CL = divup(cl - par, 2), CU = divdn(cu - par, 2);
    if (SL > SU || AL > AU || BL > BU || CL > CU) continue;
    long long A = AL, B = BL, C = CL;
    if (A + B + C < SL) {
      long long need = SL - A - B - C;
      long long DA = min(need, AU - AL);
      A += DA;
      need -= DA;
      long long DB = min(need, BU - BL);
      B += DB;
      need -= DB;
      long long DC = min(need, CU - CL);
      C += DC;
      need -= DC;
    }
    if (A + B + C < SL || A + B + C > SU) continue;
    x = B + C + par, y = A + C + par, z = A + B + par;
    return true;
  }
  return false;
}
void run() {
  scanf("%d", &n);
  for (int i = (0); i < (n); ++i)
    scanf("%lld%lld%lld", &p[i].x, &p[i].y, &p[i].z);
  long long l = -1, h = 0;
  for (int i = (0); i < (n); ++i)
    h = max(h, abs(p[i].x) + abs(p[i].y) + abs(p[i].z));
  while (l + 1 < h) {
    long long m = l + (h - l) / 2;
    if (ok(m))
      h = m;
    else
      l = m;
  }
  assert(ok(h));
  printf("%lld %lld %lld\n", x, y, z);
}
int main() {
  int n;
  scanf("%d", &n);
  for (int i = (1); i <= (n); ++i) run();
  return 0;
}
