#include <bits/stdc++.h>
using namespace std;
const long long N = 1e5 + 5;
long long read() {
  long long x = 0, f = 1;
  char ch;
  while (!isdigit(ch = getchar())) (ch == '-') && (f = -f);
  for (x = ch ^ 48; isdigit(ch = getchar());
       x = (x << 3) + (x << 1) + (ch ^ 48))
    ;
  return x * f;
}
template <class T>
void Max(T &a, T b) {
  a = a > b ? a : b;
}
template <class T>
void Min(T &a, T b) {
  a = a < b ? a : b;
}
long long n, l[4], r[4], L[4], R[4], x[N], y[N], z[N];
bool check(long long p, bool type) {
  for (long long i = 0; i <= 3; ++i) l[i] = -6e18, r[i] = 6e18;
  for (long long i = 1; i <= n; ++i) {
    Max(l[0], x[i] + y[i] + z[i] - p);
    Min(r[0], x[i] + y[i] + z[i] + p);
    Max(l[1], -x[i] + y[i] + z[i] - p);
    Min(r[1], -x[i] + y[i] + z[i] + p);
    Max(l[2], x[i] - y[i] + z[i] - p);
    Min(r[2], x[i] - y[i] + z[i] + p);
    Max(l[3], x[i] + y[i] - z[i] - p);
    Min(r[3], x[i] + y[i] - z[i] + p);
  }
  for (long long i = 0; i <= 3; ++i)
    if (l[i] > r[i]) return 0;
  for (long long A = 0, flag; A <= 1; ++A) {
    L[0] = l[0] - 3 * A, R[0] = r[0] - 3 * A;
    for (long long i = 1; i <= 3; ++i) L[i] = l[i] - A, R[i] = r[i] - A;
    for (long long i = 0; i <= 3; ++i) L[i] = (L[i] + 1) >> 1, R[i] >>= 1;
    flag = 1;
    for (long long i = 0; i <= 3; ++i)
      if (L[i] > R[i]) {
        flag = 0;
        break;
      }
    if (flag == 0) continue;
    long long L0 = L[1] + L[2] + L[3], R0 = R[1] + R[2] + R[3];
    if (R[0] >= L0 && R0 >= L[0]) {
      if (type) {
        long long a = L[1], b = L[2], c = L[3];
        if (a + b + c < L[0]) a += min(R[1] - L[1], L[0] - a - b - c);
        if (a + b + c < L[0]) b += min(R[2] - L[2], L[0] - a - b - c);
        if (a + b + c < L[0]) c += min(R[3] - L[3], L[0] - a - b - c);
        printf("%lld %lld %lld\n", b + c + A, a + c + A, a + b + A);
      }
      return 1;
    }
  }
  return 0;
}
void solve() {
  n = read();
  for (long long i = 1; i <= n; ++i)
    x[i] = read(), y[i] = read(), z[i] = read();
  long long l = 0, r = 6e18, mid, ans;
  while (l <= r) {
    mid = (l + r) >> 1;
    if (check(mid, 0))
      ans = mid, r = mid - 1;
    else
      l = mid + 1;
  }
  check(ans, 1);
}
signed main() {
  long long T = read();
  while (T-- > 0) solve();
  return 0;
}
