#include <bits/stdc++.h>
using namespace std;
const int Maxn = 100005;
struct node {
  long long x, y, z;
} w[Maxn];
struct range {
  long long l, r;
  range() {
    l = LLONG_MIN;
    r = LLONG_MAX;
  }
  void updmax(long long x) { r = min(r, x); }
  void updmin(long long x) { l = max(l, x); }
};
int n;
long long ans_a, ans_b, ans_c;
bool check(long long lim) {
  range o[4];
  for (int i = 1; i <= n; i++) {
    o[0].updmax(+w[i].x + w[i].y + w[i].z + lim);
    o[1].updmax(-w[i].x + w[i].y + w[i].z + lim);
    o[2].updmax(+w[i].x - w[i].y + w[i].z + lim);
    o[3].updmax(+w[i].x + w[i].y - w[i].z + lim);
    o[3].updmin(+w[i].x + w[i].y - w[i].z - lim);
    o[2].updmin(+w[i].x - w[i].y + w[i].z - lim);
    o[1].updmin(-w[i].x + w[i].y + w[i].z - lim);
    o[0].updmin(+w[i].x + w[i].y + w[i].z - lim);
  }
  for (int i = 0; i < 4; i++)
    if (o[i].l > o[i].r) return false;
  auto chk = [&]() {
    long long a = o[1].l + (o[1].l % 2 != 0), A = o[1].r - a;
    long long b = o[2].l + (o[2].l % 2 != 0), B = o[2].r - b;
    long long c = o[3].l + (o[3].l % 2 != 0), C = o[3].r - c;
    long long l = o[0].l, r = o[0].r;
    if (l % 2 != 0) l++;
    if (r % 2 != 0) r--;
    if (l > r) return false;
    if (A < 0 || B < 0 || C < 0) return false;
    if (A & 1) A--;
    if (B & 1) B--;
    if (C & 1) C--;
    if (a + b + c > r) return false;
    if (a + b + c >= l) {
      ans_a = a;
      ans_b = b;
      ans_c = c;
      return true;
    }
    if (a + b + c + A >= l) {
      ans_a = l - b - c;
      ans_b = b;
      ans_c = c;
      return true;
    }
    if (a + b + c + A + B >= l) {
      ans_a = a + A;
      ans_b = l - a - A - c;
      ans_c = c;
      return true;
    }
    if (a + b + c + A + B + C >= l) {
      ans_a = a + A;
      ans_b = b + B;
      ans_c = l - a - A - b - B;
      return true;
    }
    return false;
  };
  if (chk()) return true;
  o[1].l--, o[1].r--;
  o[2].l--, o[2].r--;
  o[3].l--, o[3].r--;
  o[0].l -= 3, o[0].r -= 3;
  if (chk()) {
    ans_a++;
    ans_b++;
    ans_c++;
    return true;
  }
  return false;
}
int main() {
  int T;
  scanf("%d", &T);
  while (T--) {
    scanf("%d", &n);
    for (int i = 1; i <= n; i++)
      scanf("%lld%lld%lld", &w[i].x, &w[i].y, &w[i].z);
    long long l = 0, r = 3e18;
    while (l <= r) {
      long long mid = (l + r) / 2;
      if (check(mid))
        r = mid - 1;
      else
        l = mid + 1;
    }
    check(l);
    cout << (ans_b + ans_c) / 2 << " " << (ans_a + ans_c) / 2 << " "
         << (ans_a + ans_b) / 2 << "\n";
  }
  return 0;
}
