// Slower C++ solution:
#define _CRT_SECURE_NO_WARNINGS

#define _USE_MATH_DEFINES

#include <bits/stdc++.h>

using namespace std;

#define rep(i,a,n) for (int i = a; i<n; i++)

#define per(i,a,n) for (int i = n-1; i>=a; i--)

#define pb push_back

#define mp make_pair

#define all(now) (now).begin(),(now).end()

#define fi first

#define se second

#define SZ(now) ((int)(now).size())

typedef vector<int> VI;

typedef long long ll;

typedef pair<int,int> PII;

const ll mod = 1000000007;

inline int read(int &n){char c=getchar();int x=0,f=1;while(c<'0'||c>'9'){if(c=='-')f=-1;c=getchar();}while(c>='0'&&c<='9'){x=x*10+(c-'0');c=getchar();}return n = x*f;}

ll powmod(ll a,ll b,ll mod) {ll res = 1; a%=mod; assert(b>=0); for(;b; b>>=1){if(b&1)res = res*a%mod; a = a*a%mod;}return res;}

ll gcd(ll a,ll b) { return b?gcd(b,a%b):a;}

// head

const int N = 1e2+7;

int T,n,m;

VI X,Y,H;

int main()

{

    //ios::sync_with_stdio(false), cin.tie(0), cout.tie(0);

    cin >> n;

    rep(i,0,n){

        int x, y, h;

        cin >> x >> y >> h;

        X.pb(x);

        Y.pb(y);

        H.pb(h);

    }

    rep(x,0,101){

        rep(y,0,101){

            int height = -1;

            bool flag = 0;

            rep(i,0,n){

                if(H[i]==0)

                    continue;

                if(height==-1)

                    height = H[i] + abs(X[i] - x) + abs(Y[i] - y);

                else if(height != H[i] + abs(X[i] - x) + abs(Y[i] - y))

                    flag = 1;

            }

            // rep(i,0,n){

            //     if(H[i]==0 && height-abs(X[i]-x)-(Y[i]-y) > 0)

            //         flag = 1;

            // }

            for(int i=0;i<n;i++){

				if(H[i]==0){

					if(height-abs(X[i]-x)-abs(Y[i]-y)>0)

						flag=1;

				}

			}

            if(!flag){

                // printf("%d %d %lld\n", i, j, height);

				cout<<x<<" "<<y<<" "<<height<<endl;

                return 0;

            }

        }

    }

    return 0;

}

// Faster C++ solution for the same problem (measured speedup: 5.048524377133792x):
//Acknowledgement:  Xiaoyu Han, for his "brute-force" proposal



#include <cstdio>

#include <algorithm>

#include <cstdlib>



using std::max;  using std::abs;

using std::min;



const int MAXN=105;



int N,cx,cy,ch=0,c_point,min_abs;                     //c_point: calculable point

int x[MAXN],y[MAXN],h[MAXN];



int main()

{

    scanf("%d",&N);

    for (int i=1;i<=N;++i)

        scanf("%d%d%d",&x[i],&y[i],&h[i]);

    for (cx=0;cx<=100&&ch<=0;++cx)

    {

        for (cy=0;cy<=100&&ch<=0;++cy)

        {

            min_abs=MAXN<<1;

            for (c_point=1;c_point<=N&&h[c_point]==0;++c_point);

            if (c_point==N+1)

            {

                for (int i=1;i<=N;++i)

                    min_abs=min(min_abs,abs(x[i]-cx)+abs(y[i]-cy));

                if (min_abs==1) ch=1;

            }

            else

            {

                ch=h[c_point]+abs(x[c_point]-cx)+abs(y[c_point]-cy);

                int i;

                for (i=1;i<=N&&h[i]==max(ch-abs(x[i]-cx)-abs(y[i]-cy),0);++i);

                if (i<=N) ch=0;

            }

        }

    }

    printf("%d %d %d",--cx,--cy,ch);



    return 0;

}