stablegradients/pie-gem5-pairs huggingface dataset:
// Slower C++ solution:
#include <iostream>

#include <math.h>

using namespace std;

struct pyrimid

{

	int h,x,y;

	inline int center(int& H,int& a,int& b)

	{

		int o = H - abs(x - a) - abs(y - b);

		return h ==( o > 0 ? o : 0);

	}

};

int main()

{

	int n,i,j,k;

	cin >> n;

	pyrimid *p = new pyrimid[n];

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

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

	for(i = p[0].h,k = 1;k < n;k ++)

	{

		i = i > p[k].h ? i : p[k].h;

	}

	for(;;i ++)

		for(j = 0;j <= 100;j ++)

			for(k = 0;k <= 100;k ++)

			{	

				int f = 0;

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

					if(p[g].center(i,j,k) == 1)

						f ++;

				if(f == n)

				{

					cout << j << ' ' << k << ' ' << i << endl;

					return 0;

				}

			}

}

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

#include<cmath>

#include<cstdlib>

using namespace std;

struct coo{

	int x;

	int y;

	int h;

}c[110];

int main()

{

	int n;

	cin>>n;

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

	{

		cin>>c[i].x;

		cin>>c[i].y;

		cin>>c[i].h;

	}

	int ch;

	int p=0;

	while(c[p].h==0) p++;

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

	{

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

		{

			int ch=c[p].h+abs(i-c[p].x)+abs(j-c[p].y);

			int f=0;

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

			{

				int hh=ch-abs(i-c[k].x)-abs(j-c[k].y);

				if(hh<0) hh=0;

				if(hh!=c[k].h)

				{

					f=1;

					break;

				}

			}

			if(!f)

			{

				cout<<i<<' '<<j<<' '<<ch<<endl; return 0;

			} 

		}

	}

}
// Slower C++ solution:
#include <bits/stdc++.h>



#define fr first

#define sc second

#define pb push_back

#define mk make_pair

#define mt make_tuple

#define int long long

#define OK puts("OK")

#define sz(s) (int)s.size()

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



using namespace std;





int N, X[1009], Y[1009], H[1009];

vector< tuple < int , int , int > > v;



 main() {

	cin >> N;

	tuple < int , int , int > G = mt ( -1 , -1 , -1 ) ;

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

    {

		cin >> X[i] >> Y[i] >> H[i];

		if ( H[i] >= 1)

		G = mt (X[i], Y[i], H[i]);

	}

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

	 {

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

        {

			int V = get<2> (G) + abs ( get<0> (G) - i) + abs(get<1>(G) - j);

            V = max(V, 0LL);

            bool f = true;



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

            {

				int VV = V - abs( X[k] - i) - abs ( Y[k] - j );

                VV = max(VV, 0LL);

				if (H[k] != VV)

                    f = false;

			}

			if (f == true)

                v.push_back(make_tuple(i, j, V));

		}

	}



    cout << get<0> ( v[0] ) << " " << get<1> ( v[0] ) << " " << get<2> (v[0]) << endl;



}




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

#include<cmath>

using namespace std;

int main() {

	int n;

	cin >> n;

	int i, j, k, ch, a[101][3] = { 0 };

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

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

	}

	int f = 0;

	while (a[f][2] == 0)

		f++;

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

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

			int h = abs(i - a[f][0]) + abs(j - a[f][1]) + a[f][2];

			int flag = 0;

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

				int ch = h - abs(i - a[k][0]) - abs(j - a[k][1]);

				if (ch < 0)

					ch = 0;

				if (ch != a[k][2]) {

					flag = 1;

					break;

				}

			}

			if (flag == 0) {

				cout << i << ' ' << j << ' ' << h << endl;

				return 0;

			}

		}

	}

}
// Slower C++ solution:
#include <iostream>

#include <math.h>

using namespace std;

struct pyrimid

{

	int h,x,y;

	inline int center(int& H,int& a,int& b)

	{

		int o = H - abs(x - a) - abs(y - b);

		return h ==( o > 0 ? o : 0);

	}

};

int main()

{

	int n,i,j,k;

	cin >> n;

	pyrimid *p = new pyrimid[n];

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

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

	for(i = p[0].h,k = 1;k < n;k ++)

	{

		i = i > p[k].h ? i : p[k].h;

	}

	for(;;i ++)

		for(j = 0;j <= 100;j ++)

			for(k = 0;k <= 100;k ++)

			{	

				int f = 0;

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

					if(p[g].center(i,j,k) == 1)

						f ++;

				if(f == n)

				{

					cout << j << ' ' << k << ' ' << i << endl;

					return 0;

				}

			}

}

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

#include<cmath>

using namespace std;

int main() {

	int n;

	cin >> n;

	int i, j, k, ch, a[101][3] = { 0 };

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

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

	}

	int f = 0;

	while (a[f][2] == 0)

		f++;

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

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

			int h = abs(i - a[f][0]) + abs(j - a[f][1]) + a[f][2];

			int flag = 0;

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

				int ch = h - abs(i - a[k][0]) - abs(j - a[k][1]);

				if (ch < 0)

					ch = 0;

				if (ch != a[k][2]) {

					flag = 1;

					break;

				}

			}

			if (flag == 0) {

				cout << i << ' ' << j << ' ' << h << endl;

				return 0;

			}

		}

	}

}
// Slower C++ solution:
#include <bits/stdc++.h>



#define fr first

#define sc second

#define pb push_back

#define mk make_pair

#define mt make_tuple

#define int long long

#define OK puts("OK")

#define sz(s) (int)s.size()

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



using namespace std;





int N, X[1009], Y[1009], H[1009];

vector< tuple < int , int , int > > v;



 main() {

	cin >> N;

	tuple < int , int , int > G = mt ( -1 , -1 , -1 ) ;

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

    {

		cin >> X[i] >> Y[i] >> H[i];

		if ( H[i] >= 1)

		G = mt (X[i], Y[i], H[i]);

	}

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

	 {

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

        {

			int V = get<2> (G) + abs ( get<0> (G) - i) + abs(get<1>(G) - j);

            V = max(V, 0LL);

            bool f = true;



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

            {

				int VV = V - abs( X[k] - i) - abs ( Y[k] - j );

                VV = max(VV, 0LL);

				if (H[k] != VV)

                    f = false;

			}

			if (f == true)

                v.push_back(make_tuple(i, j, V));

		}

	}



    cout << get<0> ( v[0] ) << " " << get<1> ( v[0] ) << " " << get<2> (v[0]) << endl;



}




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

#include <cmath>

using namespace std;

int main()

{

    int n;

    cin>>n;

    int num[101][3];

    for(int i=0;i!=n;i++)

    {

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

    }

    for(int i=0;i!=101;i++)

    {

        for(int j=0;j!=101;j++)

        {

            int first_non_zero_h=0;

            while(num[first_non_zero_h][2]==0)

            {

                first_non_zero_h++;

            }

            int h=abs(num[first_non_zero_h][0]-i)+abs(num[first_non_zero_h][1]-j)+num[first_non_zero_h][2];

            for(int k=0;k!=n;k++)

            {

                if(max(0,h-abs(num[k][0]-i)-abs(num[k][1]-j))!=num[k][2]) break;

                if(k==n-1)

                {

                    cout<<i<<' '<<j<<' '<<h;

                    return 0;

                }

            }

        }

    }

}
// Slower C++ solution:
#include <iostream>

#include <math.h>

using namespace std;

struct pyrimid

{

	int h,x,y;

	inline int center(int& H,int& a,int& b)

	{

		int o = H - abs(x - a) - abs(y - b);

		return h ==( o > 0 ? o : 0);

	}

};

int main()

{

	int n,i,j,k;

	cin >> n;

	pyrimid *p = new pyrimid[n];

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

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

	for(i = p[0].h,k = 1;k < n;k ++)

	{

		i = i > p[k].h ? i : p[k].h;

	}

	for(;;i ++)

		for(j = 0;j <= 100;j ++)

			for(k = 0;k <= 100;k ++)

			{	

				int f = 0;

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

					if(p[g].center(i,j,k) == 1)

						f ++;

				if(f == n)

				{

					cout << j << ' ' << k << ' ' << i << endl;

					return 0;

				}

			}

}

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

#include <cmath>

using namespace std;

int main()

{

    int n;

    cin>>n;

    int num[101][3];

    for(int i=0;i!=n;i++)

    {

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

    }

    for(int i=0;i!=101;i++)

    {

        for(int j=0;j!=101;j++)

        {

            int first_non_zero_h=0;

            while(num[first_non_zero_h][2]==0)

            {

                first_non_zero_h++;

            }

            int h=abs(num[first_non_zero_h][0]-i)+abs(num[first_non_zero_h][1]-j)+num[first_non_zero_h][2];

            for(int k=0;k!=n;k++)

            {

                if(max(0,h-abs(num[k][0]-i)-abs(num[k][1]-j))!=num[k][2]) break;

                if(k==n-1)

                {

                    cout<<i<<' '<<j<<' '<<h;

                    return 0;

                }

            }

        }

    }

}
// Slower C++ solution:
#include <bits/stdc++.h>



#define fr first

#define sc second

#define pb push_back

#define mk make_pair

#define mt make_tuple

#define int long long

#define OK puts("OK")

#define sz(s) (int)s.size()

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



using namespace std;





int N, X[1009], Y[1009], H[1009];

vector< tuple < int , int , int > > v;



 main() {

	cin >> N;

	tuple < int , int , int > G = mt ( -1 , -1 , -1 ) ;

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

    {

		cin >> X[i] >> Y[i] >> H[i];

		if ( H[i] >= 1)

		G = mt (X[i], Y[i], H[i]);

	}

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

	 {

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

        {

			int V = get<2> (G) + abs ( get<0> (G) - i) + abs(get<1>(G) - j);

            V = max(V, 0LL);

            bool f = true;



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

            {

				int VV = V - abs( X[k] - i) - abs ( Y[k] - j );

                VV = max(VV, 0LL);

				if (H[k] != VV)

                    f = false;

			}

			if (f == true)

                v.push_back(make_tuple(i, j, V));

		}

	}



    cout << get<0> ( v[0] ) << " " << get<1> ( v[0] ) << " " << get<2> (v[0]) << endl;



}




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

#include<cmath>

using namespace std;

struct point{

    int x;

    int y;

    int h;

};

int main(){

    int N;

    cin>>N;

    point *points=new point[N];

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

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

    }

    int H;

    int m,n;

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

        int find=1;

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

            find=1;

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

                if(!points[k].h)

                    continue;

                H=abs(i-points[k].x)+abs(j-points[k].y)+points[k].h;//找到第一个h非0点

            }

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

                if(points[l].h!=max(H-abs(i-points[l].x)-abs(j-points[l].y),0)){

                    find=0;

                    break;

                }

            }

            if(find){

                cout<<i<<" "<<j<<" "<<H;

                break;

            }

        }

        if(find)

            break;

    }

    return 0;

}
// Slower C++ solution:
#include <iostream>

#include <math.h>

using namespace std;

struct pyrimid

{

	int h,x,y;

	inline int center(int& H,int& a,int& b)

	{

		int o = H - abs(x - a) - abs(y - b);

		return h ==( o > 0 ? o : 0);

	}

};

int main()

{

	int n,i,j,k;

	cin >> n;

	pyrimid *p = new pyrimid[n];

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

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

	for(i = p[0].h,k = 1;k < n;k ++)

	{

		i = i > p[k].h ? i : p[k].h;

	}

	for(;;i ++)

		for(j = 0;j <= 100;j ++)

			for(k = 0;k <= 100;k ++)

			{	

				int f = 0;

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

					if(p[g].center(i,j,k) == 1)

						f ++;

				if(f == n)

				{

					cout << j << ' ' << k << ' ' << i << endl;

					return 0;

				}

			}

}

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

#include<cmath>

using namespace std;

struct point{

    int x;

    int y;

    int h;

};

int main(){

    int N;

    cin>>N;

    point *points=new point[N];

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

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

    }

    int H;

    int m,n;

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

        int find=1;

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

            find=1;

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

                if(!points[k].h)

                    continue;

                H=abs(i-points[k].x)+abs(j-points[k].y)+points[k].h;//找到第一个h非0点

            }

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

                if(points[l].h!=max(H-abs(i-points[l].x)-abs(j-points[l].y),0)){

                    find=0;

                    break;

                }

            }

            if(find){

                cout<<i<<" "<<j<<" "<<H;

                break;

            }

        }

        if(find)

            break;

    }

    return 0;

}
// Slower C++ solution:
#include <bits/stdc++.h>



#define fr first

#define sc second

#define pb push_back

#define mk make_pair

#define mt make_tuple

#define int long long

#define OK puts("OK")

#define sz(s) (int)s.size()

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



using namespace std;





int N, X[1009], Y[1009], H[1009];

vector< tuple < int , int , int > > v;



 main() {

	cin >> N;

	tuple < int , int , int > G = mt ( -1 , -1 , -1 ) ;

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

    {

		cin >> X[i] >> Y[i] >> H[i];

		if ( H[i] >= 1)

		G = mt (X[i], Y[i], H[i]);

	}

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

	 {

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

        {

			int V = get<2> (G) + abs ( get<0> (G) - i) + abs(get<1>(G) - j);

            V = max(V, 0LL);

            bool f = true;



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

            {

				int VV = V - abs( X[k] - i) - abs ( Y[k] - j );

                VV = max(VV, 0LL);

				if (H[k] != VV)

                    f = false;

			}

			if (f == true)

                v.push_back(make_tuple(i, j, V));

		}

	}



    cout << get<0> ( v[0] ) << " " << get<1> ( v[0] ) << " " << get<2> (v[0]) << endl;



}




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

#include<vector>

#include<cstdio>

#include<stdio.h>

#include<cstring>

#include<algorithm>



using namespace std;

typedef long long ll;



const int mod = 1e9+7; 



int main(){

	ios::sync_with_stdio(false);

	int m,n,ans= 0,curh,k,pos;

	cin >> n;

	vector<vector<int> > points(n, vector<int>(3));

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

		cin >> points[i][0];

		cin >> points[i][1];

		cin >> points[i][2];

		if(points[i][2] != 0)pos = i;

	}

	

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

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

			curh = abs(points[pos][0]-i) + abs(points[pos][1]-j) + points[pos][2];

			 

			for(k = 0; k < n; ++k){

				if(points[k][2] == 0){

					if(curh-points[k][2] > abs(points[k][0]-i) + abs(points[k][1]-j))break;

				}else if(curh-points[k][2] != abs(points[k][0]-i) + abs(points[k][1]-j))break;

			}

			if(k == n){

				cout << i << " " << j << " " << curh;

				return 0;

			}

		}

	}

	return 0;

}
// Slower C++ solution:
#include <iostream>

#include <math.h>

using namespace std;

struct pyrimid

{

	int h,x,y;

	inline int center(int& H,int& a,int& b)

	{

		int o = H - abs(x - a) - abs(y - b);

		return h ==( o > 0 ? o : 0);

	}

};

int main()

{

	int n,i,j,k;

	cin >> n;

	pyrimid *p = new pyrimid[n];

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

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

	for(i = p[0].h,k = 1;k < n;k ++)

	{

		i = i > p[k].h ? i : p[k].h;

	}

	for(;;i ++)

		for(j = 0;j <= 100;j ++)

			for(k = 0;k <= 100;k ++)

			{	

				int f = 0;

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

					if(p[g].center(i,j,k) == 1)

						f ++;

				if(f == n)

				{

					cout << j << ' ' << k << ' ' << i << endl;

					return 0;

				}

			}

}

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

#include<vector>

#include<cstdio>

#include<stdio.h>

#include<cstring>

#include<algorithm>



using namespace std;

typedef long long ll;



const int mod = 1e9+7; 



int main(){

	ios::sync_with_stdio(false);

	int m,n,ans= 0,curh,k,pos;

	cin >> n;

	vector<vector<int> > points(n, vector<int>(3));

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

		cin >> points[i][0];

		cin >> points[i][1];

		cin >> points[i][2];

		if(points[i][2] != 0)pos = i;

	}

	

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

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

			curh = abs(points[pos][0]-i) + abs(points[pos][1]-j) + points[pos][2];

			 

			for(k = 0; k < n; ++k){

				if(points[k][2] == 0){

					if(curh-points[k][2] > abs(points[k][0]-i) + abs(points[k][1]-j))break;

				}else if(curh-points[k][2] != abs(points[k][0]-i) + abs(points[k][1]-j))break;

			}

			if(k == n){

				cout << i << " " << j << " " << curh;

				return 0;

			}

		}

	}

	return 0;

}
// Slower C++ solution:
#include <iostream>

#include <math.h>

using namespace std;

struct pyrimid

{

	int h,x,y;

	inline int center(int& H,int& a,int& b)

	{

		int o = H - abs(x - a) - abs(y - b);

		return h ==( o > 0 ? o : 0);

	}

};

int main()

{

	int n,i,j,k;

	cin >> n;

	pyrimid *p = new pyrimid[n];

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

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

	for(i = p[0].h,k = 1;k < n;k ++)

	{

		i = i > p[k].h ? i : p[k].h;

	}

	for(;;i ++)

		for(j = 0;j <= 100;j ++)

			for(k = 0;k <= 100;k ++)

			{	

				int f = 0;

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

					if(p[g].center(i,j,k) == 1)

						f ++;

				if(f == n)

				{

					cout << j << ' ' << k << ' ' << i << endl;

					return 0;

				}

			}

}

// Faster C++ solution for the same problem (measured speedup: 2.192023876280271x):
#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
// Slower C++ solution:
#include <bits/stdc++.h>



#define fr first

#define sc second

#define pb push_back

#define mk make_pair

#define mt make_tuple

#define int long long

#define OK puts("OK")

#define sz(s) (int)s.size()

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



using namespace std;





int N, X[1009], Y[1009], H[1009];

vector< tuple < int , int , int > > v;



 main() {

	cin >> N;

	tuple < int , int , int > G = mt ( -1 , -1 , -1 ) ;

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

    {

		cin >> X[i] >> Y[i] >> H[i];

		if ( H[i] >= 1)

		G = mt (X[i], Y[i], H[i]);

	}

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

	 {

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

        {

			int V = get<2> (G) + abs ( get<0> (G) - i) + abs(get<1>(G) - j);

            V = max(V, 0LL);

            bool f = true;



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

            {

				int VV = V - abs( X[k] - i) - abs ( Y[k] - j );

                VV = max(VV, 0LL);

				if (H[k] != VV)

                    f = false;

			}

			if (f == true)

                v.push_back(make_tuple(i, j, V));

		}

	}



    cout << get<0> ( v[0] ) << " " << get<1> ( v[0] ) << " " << get<2> (v[0]) << endl;



}




// Faster C++ solution for the same problem (measured speedup: 1.1238025522791806x):
#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;

}
// Slower C++ solution:
#include <iostream>

#include <math.h>

using namespace std;

struct pyrimid

{

	int h,x,y;

	inline int center(int& H,int& a,int& b)

	{

		int o = H - abs(x - a) - abs(y - b);

		return h ==( o > 0 ? o : 0);

	}

};

int main()

{

	int n,i,j,k;

	cin >> n;

	pyrimid *p = new pyrimid[n];

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

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

	for(i = p[0].h,k = 1;k < n;k ++)

	{

		i = i > p[k].h ? i : p[k].h;

	}

	for(;;i ++)

		for(j = 0;j <= 100;j ++)

			for(k = 0;k <= 100;k ++)

			{	

				int f = 0;

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

					if(p[g].center(i,j,k) == 1)

						f ++;

				if(f == n)

				{

					cout << j << ' ' << k << ' ' << i << endl;

					return 0;

				}

			}

}

// Faster C++ solution for the same problem (measured speedup: 2.1749812583754853x):
#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;

}