#include <bits/stdc++.h>   using namespace std;   void getre() {     int x = 0;     printf( %d n , 1 / x);   }   void gettle() {     int res = 1;     while (1) res <<= 1;     printf( %d n , res);   }   template <typename T, typename S>   inline bool upmin(T &a, const S &b) {     return a > b ? a = b, 1 : 0;   }   template <typename T, typename S>   inline bool upmax(T &a, const S &b) {     return a < b ? a = b, 1 : 0;   }   template <typename N, typename PN>   inline N flo(N a, PN b) {     return a >= 0 ? a / b : -((-a - 1) / b) - 1;   }   template <typename N, typename PN>   inline N cei(N a, PN b) {     return a > 0 ? (a - 1) / b + 1 : -(-a / b);   }   template <typename N>   N gcd(N a, N b) {     return b ? gcd(b, a % b) : a;   }   template <typename N>   inline int sgn(N a) {     return a > 0 ? 1 : (a < 0 ? -1 : 0);   }   inline void gn(long long &x) {     int sg = 1;     char c;     while (((c = getchar()) <  0  || c >  9 ) && c !=  - )       ;     c ==  -  ? (sg = -1, x = 0) : (x = c -  0 );     while ((c = getchar()) >=  0  && c <=  9 ) x = x * 10 + c -  0 ;     x *= sg;   }   inline void gn(int &x) {     long long t;     gn(t);     x = t;   }   inline void gn(unsigned long long &x) {     long long t;     gn(t);     x = t;   }   inline void gn(double &x) {     double t;     scanf( %lf , &t);     x = t;   }   inline void gn(long double &x) {     double t;     scanf( %lf , &t);     x = t;   }   inline void gs(char *s) { scanf( %s , s); }   inline void gc(char &c) {     while ((c = getchar()) > 126 || c < 33)       ;   }   inline void pc(char c) { putchar(c); }   inline long long sqr(long long a) { return a * a; }   inline double sqrf(double a) { return a * a; }   const int inf = 0x3f3f3f3f;   const double pi = 3.14159265358979323846264338327950288L;   const double eps = 1e-6;   int n;   long long x[111111], y[111111], z[111111];   int out = 0;   bool check(long long d, int par) {     long long lz, rz;     lz = -7e18, rz = 7e18;     long long l10, r10, l20, r20;     long long l1, r1, l2, r2;     l1 = l2 = -7e18;     r1 = r2 = 7e18;     for (int i = (1), _ed = (n + 1); i < _ed; i++) {       upmax(l1, x[i] + y[i] + z[i] - d);       upmin(r1, x[i] + y[i] + z[i] + d);       upmax(l2, x[i] + y[i] - z[i] - d);       upmin(r2, x[i] + y[i] - z[i] + d);     }     if ((l1 & 1) != par) l1++;     if ((l2 & 1) != par) l2++;     if ((r1 & 1) != par) r1--;     if ((r2 & 1) != par) r2--;     if (l1 > r1 || l2 > r2) return 0;     upmin(rz, (r1 - l2) / 2ll);     upmax(lz, (l1 - r2) / 2ll);     l10 = l1;     r10 = r1;     l20 = l2;     r20 = r2;     l1 = l2 = -7e18;     r1 = r2 = 7e18;     for (int i = (1), _ed = (n + 1); i < _ed; i++) {       upmax(l1, x[i] - y[i] + z[i] - d);       upmin(r1, x[i] - y[i] + z[i] + d);       upmax(l2, x[i] - y[i] - z[i] - d);       upmin(r2, x[i] - y[i] - z[i] + d);     }     if ((l1 & 1) != par) l1++;     if ((l2 & 1) != par) l2++;     if ((r1 & 1) != par) r1--;     if ((r2 & 1) != par) r2--;     if (l1 > r1 || l2 > r2) return 0;     upmin(rz, (r1 - l2) / 2ll);     upmax(lz, (l1 - r2) / 2ll);     if (lz > rz) return 0;     long long z = lz;     long long lplu = max(l10 - z, l20 + z);     long long rplu = min(r10 - z, r20 + z);     long long lmin = max(l1 - z, l2 + z);     long long rmin = min(r1 - z, r2 + z);     long long x = (lplu + lmin) / 2, y = (lplu - lmin) / 2;     if (out) {       out = 0;       printf( %I64d %I64d %I64d n , x, y, z);     }     return 1;   }   int main() {     int te;     gn(te);     while (te--) {       gn(n);       for (int i = (1), _ed = (n + 1); i < _ed; i++) {         gn(x[i]);         gn(y[i]);         gn(z[i]);       }       long long l = 0, r = 3.1e18;       while (l <= r) {         long long mid = l + r >> 1;         if (check(mid, 0) || check(mid, 1))           r = mid - 1;         else           l = mid + 1;       }       out = 1;       check(l, 0);       check(l, 1);     }     return 0;   }