#include <bits/stdc++.h>
using namespace std;
template <class X, class Y>
void amax(X& x, const Y& y) {
  if (x < y) x = y;
}
template <class X, class Y>
void amin(X& x, const Y& y) {
  if (x > y) x = y;
}
const int INF = 1e9 + 10;
const long long INFL = 1e18 + 10;
const int MAX = 1e5 + 10;
struct point {
  long long x, y, z;
};
struct equation {
  pair<long long, long long> S, a, b, c;
};
int n;
point crd[MAX];
void update(pair<long long, long long>& a,
            const pair<long long, long long>& b) {
  amax(a.first, b.first);
  amin(a.second, b.second);
}
point get_solution(const equation& eq) {
  if (eq.S.first > eq.S.second || eq.a.first > eq.a.second ||
      eq.b.first > eq.b.second || eq.c.first > eq.c.second)
    return point{INT64_MAX, INT64_MAX, INT64_MAX};
  if ((eq.a.first + eq.b.first + eq.c.first > eq.S.second) ||
      (eq.a.second + eq.b.second + eq.c.second < eq.S.first))
    return point{INT64_MAX, INT64_MAX, INT64_MAX};
  point res;
  res.x = eq.a.first;
  res.y = eq.b.first;
  res.z = eq.c.first;
  long long delta = max(0ll, eq.S.first - res.x - res.y - res.z);
  res.x += min(delta, eq.a.second - eq.a.first);
  delta -= min(delta, eq.a.second - eq.a.first);
  res.y += min(delta, eq.b.second - eq.b.first);
  delta -= min(delta, eq.b.second - eq.b.first);
  res.z += min(delta, eq.c.second - eq.c.first);
  delta -= min(delta, eq.c.second - eq.c.first);
  assert(delta == 0);
  return res;
}
long long DIV2(long long x) { return (x - (x & 1)) / 2; }
point check(long long D) {
  equation eq;
  eq.S = eq.a = eq.b = eq.c = make_pair(INT64_MIN, INT64_MAX);
  for (int i = 1; i <= n; i++) {
    equation nw;
    nw.S = make_pair(-D + crd[i].x + crd[i].y + crd[i].z,
                     D + crd[i].x + crd[i].y + crd[i].z);
    nw.a = make_pair(-D - crd[i].x + crd[i].y + crd[i].z,
                     D - crd[i].x + crd[i].y + crd[i].z);
    nw.b = make_pair(-D + crd[i].x - crd[i].y + crd[i].z,
                     D + crd[i].x - crd[i].y + crd[i].z);
    nw.c = make_pair(-D + crd[i].x + crd[i].y - crd[i].z,
                     D + crd[i].x + crd[i].y - crd[i].z);
    update(eq.S, nw.S);
    update(eq.a, nw.a);
    update(eq.b, nw.b);
    update(eq.c, nw.c);
  }
  for (int r = 0; r < 2; r++) {
    equation tr = eq;
    tr.S.first = DIV2(tr.S.first - 3 * r + 1);
    tr.a.first = DIV2(tr.a.first - r + 1);
    tr.b.first = DIV2(tr.b.first - r + 1);
    tr.c.first = DIV2(tr.c.first - r + 1);
    tr.S.second = DIV2(tr.S.second - 3 * r);
    tr.a.second = DIV2(tr.a.second - r);
    tr.b.second = DIV2(tr.b.second - r);
    tr.c.second = DIV2(tr.c.second - r);
    point sol = get_solution(tr);
    if (sol.x != INT64_MAX) {
      point ans;
      ans.x = sol.y + sol.z + r;
      ans.y = sol.x + sol.z + r;
      ans.z = sol.x + sol.y + r;
      return ans;
    }
  }
  return point{INT64_MAX, INT64_MAX, INT64_MAX};
}
point bfind() {
  long long l = 0, r = 3e18, i = (l + r) / 2;
  while (l != i && i != r) {
    if (check(i).x != INT64_MAX)
      r = i;
    else
      l = i;
    i = (l + r) / 2;
  }
  for (long long i = l; i <= r; i++) {
    point ret = check(i);
    if (ret.x != INT64_MAX) return ret;
  }
  return point();
}
void process() {
  int t;
  cin >> t;
  while (t--) {
    cin >> n;
    for (int i = 1; i <= n; i++) cin >> crd[i].x >> crd[i].y >> crd[i].z;
    point ans = bfind();
    cout << ans.x << " " << ans.y << " " << ans.z << '\n';
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  process();
}
