// Slower C++ solution:
// e-pyramid

#include <iostream>



using namespace std;



const int SIDE = 101;



int known[104][3];

int lk = 0;

int possible[11000][3];

int lp = 0;

int tmp_possible[11000][3];

int lt = 0;



int distance(int x1, int y1, int x2, int y2) {

    return abs(x1-x2) + abs(y1-y2);

}



int expect_peak_height(int xt, int yt, int xo, int yo, int ho) {

    return distance(xt, yt, xo, yo) + ho;

}



void print_possible() {

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

        cout << possible[i][0] << ' ' << possible[i][1] << ' ' << possible[i][2] << endl;

    }

}



int main() {

    int N;

    cin >> N;



    int tmp_x, tmp_y, tmp_h;

    

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

        cin >> tmp_x >> tmp_y >> tmp_h;

        known[lk][0] = tmp_x;

        known[lk][1] = tmp_y;

        known[lk++][2] = tmp_h;



    }



    int first_not_zero = 0;

    // 找到第一个不为 0 的已知点

    while (known[first_not_zero][2] == 0)

        first_not_zero++;



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

        for (int j=0; j<SIDE; j++) {

            int x = known[first_not_zero][0];

            int y = known[first_not_zero][1];

            int h = known[first_not_zero][2];



            possible[lp][0] = i;

            possible[lp][1] = j;

            possible[lp++][2] = expect_peak_height(i, j, x, y, h);

        }

    }



    for (int i=first_not_zero+1; i<lk; i++) {

        for (int j=0; j<lp; j++) {

            int px = possible[j][0];

            int py = possible[j][1];

            int ph = possible[j][2];



            int test_x = known[i][0];

            int test_y = known[i][1];

            int test_h = known[i][2];



            if (test_h != 0) {

                if (expect_peak_height(px, py, test_x, test_y, test_h) == ph) {

                    tmp_possible[lt][0] = possible[j][0];

                    tmp_possible[lt][1] = possible[j][1];

                    tmp_possible[lt++][2] = possible[j][2];

                }

            } else {  // case of test_h = 0

                if (expect_peak_height(px, py, test_x, test_y, test_h) >= ph) {

                    tmp_possible[lt][0] = possible[j][0];

                    tmp_possible[lt][1] = possible[j][1];

                    tmp_possible[lt++][2] = possible[j][2];

                }

            }

        }

        for (int j=0; j<lt; j++) {

                possible[j][0] = tmp_possible[j][0];

                possible[j][1] = tmp_possible[j][1];

                possible[j][2] = tmp_possible[j][2];

        }

        lp = lt;

        lt = 0;

    }



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

        for (int j=0; j<lp; j++) {

            int px = possible[j][0];

            int py = possible[j][1];

            int ph = possible[j][2];



            int test_x = known[i][0];

            int test_y = known[i][1];

            int test_h = known[i][2];



            if (test_h != 0) {

                if (expect_peak_height(px, py, test_x, test_y, test_h) == ph) {

                    tmp_possible[lt][0] = possible[j][0];

                    tmp_possible[lt][1] = possible[j][1];

                    tmp_possible[lt++][2] = possible[j][2];

                }

            } else {  // case of test_h = 0

                if (expect_peak_height(px, py, test_x, test_y, test_h) >= ph) {

                    tmp_possible[lt][0] = possible[j][0];

                    tmp_possible[lt][1] = possible[j][1];

                    tmp_possible[lt++][2] = possible[j][2];

                }

            }

        }

        for (int j=0; j<lt; j++) {

                possible[j][0] = tmp_possible[j][0];

                possible[j][1] = tmp_possible[j][1];

                possible[j][2] = tmp_possible[j][2];

        }

        lp = lt;

        lt = 0;

    }





    print_possible();

}

// Faster C++ solution for the same problem (measured speedup: 1.1385185692789432x):
#include<iostream>

#include<math.h>

using namespace std;

int check(int a[100][3],int N,int x,int y){

	int b[100],d[100],j=0;

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

		b[i]=a[i][2]+fabs(double(a[i][0]-x))+fabs(double(a[i][1]-y));

	}

	int q=0;

	for(int k=0;k<N;k++){

		if(a[k][2]>0){

			q=b[k];

		}

	}

	for(int p=0;p<N;p++){

		if(a[p][2]==0){

			if(b[p]<q)

				return 0;

		}

		else{

			if(b[p]!=q)

				return 0;

		}

	}

	return q;

}

int main(){

	int N;

	cin>>N;

	int a[100][3];

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

		cin>>a[i][0]>>a[i][1]>>a[i][2];

	}

	for(int x=0;x<=100;x++)

		for(int y=0;y<=100;y++){

			int f=check(a,N,x,y);

			if(f!=0){

				cout<<x<<" "<<y<<" "<<f<<endl;

				return 0;

			}

		}

	return 0;

}