// 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.1474397206125493x):
#include <iostream>

#include <stdio.h>

#include <algorithm>

#include <vector>

#include <math.h>



using namespace std;

/*

int maximum(int* x, int N)

{

	int M = 0;

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

		M = (M > x[i] ? M : x[i]);

	return M;

}

int minimum(int* x, int N)

{

	int m = 0;

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

		m = (m < x[i] ? m : x[i]);

	return m;

}*/

int height(int x, int y, int x_pot, int y_pot, int H_pot)

{

	int h;

	h = max(H_pot - abs(x - x_pot) - abs(y - y_pot), 0);

	return h;

}



int main()

{

	/*---Read Parameters-----*/

	int N;

	cin >> N;

	int* x = new int[N];

	int* y = new int[N];

	long long* h = new long long[N];

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

		cin >> x[i] >> y[i] >> h[i];

	/*---Read Parameters: Completed-----*/

	/*-----Try every (x, y) for the centre-----*/

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

	//	cout << x[i] << ' ' << y[i] << ' ' << h[i] << '\n';

	int xc = 0, yc = 0;

	long long H = 0;

	//putchar('\n');

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

	{

		//printf("x_pot = %d\t", x_pot);

		bool larger_flag = false;

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

		{

			//printf("y_pot = %d\n", y_pot);

			long long H_pot = 1;	//pot means "potential".

			for (int n = 0; n < N; n++)	//To find the potential H_pot, and that requires an h != 0.

				if (h[n] != 0)	//And if no h != 0 is in the array, H_pot will be considered 1.

				{

					//cout << h[n] << ' ' << n;

					H_pot = h[n] + abs(x[n] - x_pot) + abs(y[n] - y_pot);

					break;

				}

			bool flag = true;

			for (int n = 0; n < N; n++)

				if (h[n] != height(x[n], y[n], x_pot, y_pot, H_pot))

				{

					flag = false;

					break;

				}

			if (flag == true)

			{

				larger_flag = true;

				yc = y_pot;

				H = H_pot;

				break;

			}

		}

		if (larger_flag == true)

		{

			xc = x_pot;

			break;

		}

	}

	std::cout << xc << ' ' << yc << ' ' << H;

	getchar(); getchar();

	return 0;

}



//Ref: https://blog.csdn.net/qq_33241119/article/details/82954937