stablegradients/pie-gem5-bysrc huggingface dataset:
// Original C++ solution (slower):
#include<iostream>

using namespace std;

int main() {

	int n;

	cin>>n;

	int t=n%10;

	if(t== 2||t== 4||t==5||t== 7||t==  9) {

		cout<<"hon"<<endl;

	} else if(t==0||t==1||t== 6||t== 8) {

		cout<<"pon"<<endl;

	} else if(t==3) {

		cout<<"bon"<<endl;

	}

	return 0;

}

// Optimized solution to the same problem (faster):
#include <stdio.h>



int main(){

	int num;

	scanf("%d",&num);

	if (num%10==2||num%10==4||num%10==5||num%10==7||num%10==9){

		printf("hon\n");

	}

	else if(num%10==0||num%10==1||num%10==6||num%10==8){

		printf("pon\n");

	}

	else if(num%10==3){

		printf("bon\n");

	}

	return 0;

}


// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <bits/stdc++.h>



using namespace std;



int main(){

    int N, C;

    cin>>N;

    C = N % 10;

    if (C == 2 || C == 4 || C == 5 || C == 7 || C == 9){

        cout<<"hon";

    }

    else if (C == 0 || C == 1 || C == 6 || C == 8){

        cout<<"pon";

    }

    else {

        cout<<"bon";

    }

    return 0;

}


// Optimized solution to the same problem (faster):
#include <stdio.h>



int main(){

	int num;

	scanf("%d",&num);

	if (num%10==2||num%10==4||num%10==5||num%10==7||num%10==9){

		printf("hon\n");

	}

	else if(num%10==0||num%10==1||num%10==6||num%10==8){

		printf("pon\n");

	}

	else if(num%10==3){

		printf("bon\n");

	}

	return 0;

}


// Fastest known solution for this problem:
// Original C++ solution (slower):
#include<bits/stdc++.h>

using namespace std;



int main(void)

{

    short int n;

    cin>>n;

    int one = n%10;



    if(one==3) cout<<"bon"<<endl;

    else if(one==2 || one==4 || one==5 || one==7 || one==9) cout<<"hon"<<endl;

    else cout<<"pon"<<endl;

}

// Optimized solution to the same problem (faster):
#include <stdio.h>



int main(){

	int num;

	scanf("%d",&num);

	if (num%10==2||num%10==4||num%10==5||num%10==7||num%10==9){

		printf("hon\n");

	}

	else if(num%10==0||num%10==1||num%10==6||num%10==8){

		printf("pon\n");

	}

	else if(num%10==3){

		printf("bon\n");

	}

	return 0;

}


// Fastest known solution for this problem:
// Original C++ solution (slower):
#include<iostream>

using namespace std;

int main(){

	int a;cin>>a;

	a=a%10;

	if(a==3) cout<<"bon";

	else if(a==2||a==4||a==5||a==7||a==9) cout<<"hon";

	else cout<<"pon";

}

// Optimized solution to the same problem (faster):


#include <stdio.h>

int main(){

	int n,a;

	scanf("%d",&n);

	a=n%10;

	if(a==2||a==4||a==5||a==7||a==9)printf("hon\n");

	else if(a==0||a==1||a==6||a==8)printf("pon\n");

	else if(a==3)printf("bon\n");

	return 0;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include<iostream>

#include<string>

#include<queue>

#include<algorithm>

#include<map>

#include<set>

#include<vector>

#include<math.h>



using namespace std;



#define INF 1000000007

#define LINF (1LL << 62)



typedef long long i64;

typedef pair<i64,i64> P;





int n, t[202], v[202];

vector<int> ma(202020,INF);

double ans = 0;



int main(){

	cin >> n;

	int T = 0;

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

		cin >> t[i];

		T += t[i]*2;

	}

	int now = 0;

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

		cin >> v[i];

		for(int j = 0; j <= t[i]*2; j++){

			ma[now] = min(v[i]*2, ma[now]);

			now++;

		}

		now--;

	}

	

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

		ma[i] = min(min(T-i,i), ma[i]);

	}

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

		if(i != 0){

			if(ma[i-1] < ma[i]-1){

				ma[i] = ma[i-1]+1;

			}

			if(ma[T+1-i] < ma[T-i]-1){

				ma[T-i] = ma[T+1-i]+1;

			}

		}

	}

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

		ans += ma[i];

	}

	printf("%.10f\n", ans/4);

	

	return 0;

}

// Optimized solution to the same problem (faster):
#include<bits/stdc++.h>



using namespace std;



#define INF 1000000007

#define LINF (1LL << 60)

#define PI 3.14159265358979



typedef long long i64;

typedef pair<i64,i64> P;



inline i64 mod(i64 a, i64 m) { return (a % m + m) % m; }



template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }

template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }







int n, t[101], d[101], v[101];

int sp[40404];

void solve(){

	cin >> n;

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

		cin >> t[i];

		t[i] *= 2;

		d[i] = d[i-1]+t[i];

	}

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

		cin >> v[i];

		v[i] *= 2;

		fill(sp+d[i-1], sp+d[i], v[i]); //max

	}

	

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

		if(v[i] > v[i-1]){

			for(int j = d[i-1]; j < d[i]; j++){

				chmin(sp[j], v[i-1]+j-d[i-1]);

			}

		}

		if(v[i] > v[i+1]){

			for(int j = d[i+1]; j >= d[i]; j--){

				chmin(sp[j], v[i+1]+d[i+1]-j);

			}

		}

	}

	for(int i = 1; i < d[n]; i++){

		chmin(sp[i], sp[i-1]+1);

	}

	for(int i = d[n]; i > 0; i--){

		chmin(sp[i], sp[i+1]+1);

	}

	

	i64 ans = 0;

	for(int i = 1; i < d[n]; i++){

		ans += sp[i];

		

	}

	printf("%.10f\n", ans/4.0);

}



int main(){

	std::cin.tie(0);

	std::ios::sync_with_stdio(false);

	int t = 1;

	//cin >> t;

	while(t--){

		solve();

	}

	

	return 0;

}


// Fastest known solution for this problem:
// Original C++ solution (slower):
#include<bits/stdc++.h>



using namespace std;



#define INF 1000000007

#define LINF (1LL << 60)

#define PI 3.14159265358979



typedef long long i64;

typedef pair<i64,i64> P;



inline i64 mod(i64 a, i64 m) { return (a % m + m) % m; }



template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }

template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }







int n, t[101], d[101], v[101];

int sp[40404];

void solve(){

	cin >> n;

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

		cin >> t[i];

		t[i] *= 2;

		d[i] = d[i-1]+t[i];

	}

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

		cin >> v[i];

		v[i] *= 2;

		fill(sp+d[i-1], sp+d[i], v[i]); //max

	}

	

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

		if(v[i] > v[i-1]){

			for(int j = d[i-1]; j < d[i]; j++){

				chmin(sp[j], v[i-1]+j-d[i-1]);

			}

		}

		if(v[i] > v[i+1]){

			for(int j = d[i+1]; j >= d[i]; j--){

				chmin(sp[j], v[i+1]+d[i+1]-j);

			}

		}

	}

	for(int i = 1; i < 40404; i++){

		chmin(sp[i], sp[i-1]+1);

	}

	for(int i = 40000; i > 0; i--){

		chmin(sp[i], sp[i+1]+1);

	}

	

	i64 ans = 0;

	for(int i = 1; i < 40404; i++){

		ans += sp[i];

		

	}

	printf("%.10f\n", ans/4.0);

}



int main(){

	std::cin.tie(0);

	std::ios::sync_with_stdio(false);

	int t = 1;

	//cin >> t;

	while(t--){

		solve();

	}

	

	return 0;

}


// Optimized solution to the same problem (faster):
#include<bits/stdc++.h>



using namespace std;



#define INF 1000000007

#define LINF (1LL << 60)

#define PI 3.14159265358979



typedef long long i64;

typedef pair<i64,i64> P;



inline i64 mod(i64 a, i64 m) { return (a % m + m) % m; }



template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }

template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }







int n, t[101], d[101], v[101];

int sp[40404];

void solve(){

	cin >> n;

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

		cin >> t[i];

		t[i] *= 2;

		d[i] = d[i-1]+t[i];

	}

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

		cin >> v[i];

		v[i] *= 2;

		fill(sp+d[i-1], sp+d[i], v[i]); //max

	}

	

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

		if(v[i] > v[i-1]){

			for(int j = d[i-1]; j < d[i]; j++){

				chmin(sp[j], v[i-1]+j-d[i-1]);

			}

		}

		if(v[i] > v[i+1]){

			for(int j = d[i+1]; j >= d[i]; j--){

				chmin(sp[j], v[i+1]+d[i+1]-j);

			}

		}

	}

	for(int i = 1; i < d[n]; i++){

		chmin(sp[i], sp[i-1]+1);

	}

	for(int i = d[n]; i > 0; i--){

		chmin(sp[i], sp[i+1]+1);

	}

	

	i64 ans = 0;

	for(int i = 1; i < d[n]; i++){

		ans += sp[i];

		

	}

	printf("%.10f\n", ans/4.0);

}



int main(){

	std::cin.tie(0);

	std::ios::sync_with_stdio(false);

	int t = 1;

	//cin >> t;

	while(t--){

		solve();

	}

	

	return 0;

}


// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <bits/stdc++.h>

#define REP(i, n) for (int i = 0; i < n; i++)

#define FOR(i, m, n) for (int i = m; i < n; i++)

#define ll long long int

const int INF = 2147483647;



using namespace std;



int main()

{

  double maxv[40001] = {};

  int t[100] = {};

  // 何秒から始まるか(長さはt[i]を見るとわかる)

  pair<int, double> v[100] = {};

  int n;

  int T = 0;

  cin >> n;

  REP(i, n)

  {

    cin >> t[i];

  }

  REP(i, n)

  {

    double vi;

    cin >> vi;

    v[i] = make_pair(T, vi);

    T += t[i];

  }



  REP(i, 2 * T + 1)

  {

    maxv[i] = 50000;

  }



  // maxv[i]を決める

  // t = i/2

  REP(i, 2 * T + 1)

  {

    maxv[i] = min(maxv[i], (double)i / 2);

    maxv[i] = min(maxv[i], (double)T - (double)i / 2);

    REP(j, n)

    {

      if ((double)i / 2 < v[j].first)

      {

        maxv[i] = min(maxv[i], v[j].second + ((double)(2 * v[j].first - i) / 2));

      }

      else if ((double)i / 2 > v[j].first + t[j])

      {

        maxv[i] = min(maxv[i], v[j].second + ((double)(i - 2 * (v[j].first + t[j])) / 2));

      }

      else

      {

        maxv[i] = min(maxv[i], v[j].second);

      }

    }

  }



  double ans = 0;

  FOR(i, 1, 2 * T + 1)

  {

    ans += 0.25 * (maxv[i - 1] + maxv[i]);

  }



  cout << fixed << setprecision(6) << ans << endl;

}


// Optimized solution to the same problem (faster):
#line 1 "/mnt/c/Users/leafc/dev/compro/lib/template.hpp"





#include <bits/stdc++.h>

#define REP(i, n) for (int i = 0; i < n; i++)

#define FOR(i, m, n) for (int i = m; i < n; i++)

#define ALL(v) (v).begin(), (v).end()

#define coutd(n) cout << fixed << setprecision(n)

#define ll long long int

#define vl vector<ll>

#define vi vector<int>

#define MM << " " <<



using namespace std;



template <class T> void say(bool val, T yes = "Yes", T no = "No") { cout << (val ? yes : no) << endl; }



template <class T> void chmin(T &a, T b) {

  if (a > b)

    a = b;

}



template <class T> void chmax(T &a, T b) {

  if (a < b)

    a = b;

}





#line 2 "tmp.cpp"



int main() {

  cin.tie(0);

  ios::sync_with_stdio(false);



  int n;

  cin >> n;

  vector<int> t(n + 2, 0);

  vector<double> v(n + 2, 0);

  int sum = 0;

  REP(i, n) {

    cin >> t[i + 1];

    sum += t[i + 1];

    t[i + 1] += t[i];

  }

  t[n + 1] = sum;

  REP(i, n) { cin >> v[i + 1]; }



  vector<double> ans(2 * sum + 1, 0.0);

  FOR(j, 1, 2 * sum + 1) {

    double tmp = 2 * sum;

    double time = (double)j / 2;



    FOR(i, 1, n + 1) {

      if (time < t[i - 1]) {

        chmin(tmp, t[i - 1] - time + v[i]);

        // cout << "top: " MM t[i - 1] - time + v[i] << endl;



      } else if (t[i] < time) {

        chmin(tmp, time - t[i] + v[i]);

        // cout << "middle: " MM time - t[i] + v[i] << endl;

      } else {

        chmin(tmp, v[i]);

        // cout << "bottom: " MM v[i] << endl;

      }

    }

    chmin(tmp, time);

    chmin(tmp, sum - time);

    ans[j] = tmp;

    // cout << time MM ans[j] << endl;

  }



  double val = 0;

  FOR(i, 1, 2 * sum + 1) { val += (ans[i] + ans[i - 1]) / 4; }

  coutd(5) << val << endl;



  return 0;

}


// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <bits/stdc++.h>

using namespace std;

#define ll long long int

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

#define dump(x)  cerr << #x << " = " << (x) << endl;

#define INF 2000000000

#define mod 1000000007

#define INF2 1000000000000000000





int main(void)

{

    cin.tie(0);

    ios::sync_with_stdio(false);

    int N;

    cin >> N;

    int t[N], v[N];

    rep(i, N) cin >> t[i];

    rep(i, N) cin >> v[i];



    int spd[80010] = {};

    int tmpT = 0;

    int tmpspd = 0;

    rep(i, N) {

        rep(j, t[i]*2) {

            spd[j+tmpT*2] = tmpspd;

            tmpspd++;

            tmpspd = min(tmpspd, v[i]*2);

        }

        tmpT += t[i];

    }

    tmpspd = 0;

    for (int i = N-1; i >= 0; i--) {

        tmpT -= t[i];

        for (int j = t[i]*2; j > 0; j--) {

            spd[j+tmpT*2] = min(spd[j+tmpT*2], tmpspd);

            tmpspd++;

            tmpspd = min(tmpspd, v[i]*2);

        }

    }

    double ans = 0;

    rep(i, 80010) {

        ans += spd[i];

        if (spd[i] != 0) {

            //cout << "spd[" << i/(2.0) << "] = " << spd[i]/2.0 << endl;

        }

    }

    printf("%.5f\n", ans/4.0);

    //cout << ans/4.0 << endl;



    return 0;

}


// Optimized solution to the same problem (faster):
#include "bits/stdc++.h"

using namespace std;

#define ll long long int

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

#define rrep(i,n) for( int i = n; i >= 0; i-- )

#define REP(i,s,t) for( int i = s; i <= t; i++ )

#define RREP(i,s,t) for( int i = s; i >= t; i-- )

#define dump(x)  cerr << #x << " = " << (x) << endl;

#define INF 2000000000

#define mod 1000000007

#define INF2 1000000000000000000





int main(void)

{

    cin.tie(0);

    ios::sync_with_stdio(false);

    int N; cin >> N;

    int t[110], v[110];

    rep(i, N) cin >> t[i];

    int sum = 0;

    rep(i, N) sum += t[i];

    rep(i, N) cin >> v[i];

    int s[40010];

    rep(i, 40010) {

        s[i] = INF;

    }

    s[0] = 0;

    int T = 0;

    rep(i, N) {

        for(int j = T; j < T + t[i] * 2; j += 2) {

            s[j + 1] = min({s[j + 1], v[i] * 2, s[j] + 1}); 

            s[j + 2] = min({s[j + 2], v[i] * 2, s[j] + 2}); 

        }

        T += t[i] * 2;

    }

    //rep(i, sum * 2 + 1) cout << fixed << setprecision(1) << i/2.0 << " " << s[i]/2.0 << endl;

    //cout << endl;

    T = sum * 2;

    s[sum * 2] = 0;

    RREP(i, N - 1, 0) {

        for(int j = T; j > T - t[i] * 2; j -= 2) {

            s[j - 1] = min({s[j - 1], v[i] * 2, s[j] + 1});

            s[j - 2] = min({s[j - 2], v[i] * 2, s[j] + 2}); 

        }

        T -= t[i] * 2;

    }

    int ans = 0;

    // rep(i, sum * 2 + 1) cout << fixed << setprecision(1) << i/2.0 << " " << s[i]/2.0 << endl;

    // cout << endl;

    rep(i, sum * 2 + 1) ans += s[i];

    cout << fixed << setprecision(12) << ans/4.0 << endl;



    return 0;

}


// Fastest known solution for this problem:
// Original C++ solution (slower):
///By Stephan Ramirez dsramirezc@unal.edu.co

#include<bits/stdc++.h>

#define ms(a,v) memset(a,v,sizeof a)

#define ll long long

#define N 101

using namespace std;

int n;

ll s[N][3];

int main(){

	#ifdef LOCAL

		freopen("in.txt","r",stdin);

		//freopen("out.txt","w",stdout);

	#endif

    scanf("%d",&n);

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

        scanf("%lld %lld %lld",&s[i][0],&s[i][1],&s[i][2]);

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

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

            set<ll> st;

            ll mx=1e10;

            bool flag=true;

            int ind=-1;

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

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

                    ll h=s[k][2]+abs(i-s[k][0])+abs(j-s[k][1]);

                    ind=k;

                    st.insert(h);

                }else{

                    mx=min(mx,abs(i-s[k][0])+abs(j-s[k][1]));

                }

            }

            if(st.size()==1 && s[ind][2]+abs(i-s[ind][0])+abs(j-s[ind][1])>0 && s[ind][2]+abs(i-s[ind][0])+abs(j-s[ind][1])<=mx){

                cout<<i<<" "<<j<<" "<<s[ind][2]+abs(i-s[ind][0])+abs(j-s[ind][1])<<endl;

                return 0;

            }

        }

    }



	return 0;

}




// Optimized solution to the same problem (faster):
#include <cstdio>

int abs(int x) {

    return x > 0 ? x : -x;

}

int n, x[102], y[102], l[102], stdPoint, ansx, ansy, h;

bool check(){

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

        int t=h-abs(ansx-x[i])-abs(ansy-y[i]);

        if(t<0)t=0;

        if(l[i]!=t)return false;

    }

    return true;

}

int main() {

    scanf("%d", &n);

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

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

        if (l[i])

            stdPoint = i;

    }

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

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

            ansx = i, ansy = j;

            h = l[stdPoint] + abs(x[stdPoint] - i) + abs(y[stdPoint] - j);

            if (check()){

                printf("%d %d %d\n",ansx,ansy,h);

                return 0;

            }

        }

    }

    return 0;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <iostream>

#include <algorithm>

#include <string>

using namespace std;

const int M=100;

int A[M+5][M+5];

int x[M+5],y[M+5],h[M+5];

bool check_h(int wh,int n,int a,int b)

{

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

	{

		if(h[i]&&(abs(x[i]-a)+abs(y[i]-b)+h[i]!=wh)) return 0;

		if(!h[i]&&(abs(x[i]-a)+abs(y[i]-b)<wh)) return 0;

	}

	return 1;

}

int main()

{

	int n;

	cin>>n;

	int f=0;

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

	{

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

		if(h[i]!=0) f=i;

	}

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

	{

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

		{

			int new_h=h[f]+abs(x[f]-i)+abs(y[f]-j);

			if(check_h(new_h,n,i,j))

			{

				cout<<i<<' '<<j<<' '<<new_h<<endl;

				return 0;

			}

		}

	}

	return 0;

}


// Optimized solution to the same problem (faster):
#include <cstdio>

int abs(int x) {

    return x > 0 ? x : -x;

}

int n, x[102], y[102], l[102], stdPoint, ansx, ansy, h;

bool check(){

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

        int t=h-abs(ansx-x[i])-abs(ansy-y[i]);

        if(t<0)t=0;

        if(l[i]!=t)return false;

    }

    return true;

}

int main() {

    scanf("%d", &n);

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

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

        if (l[i])

            stdPoint = i;

    }

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

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

            ansx = i, ansy = j;

            h = l[stdPoint] + abs(x[stdPoint] - i) + abs(y[stdPoint] - j);

            if (check()){

                printf("%d %d %d\n",ansx,ansy,h);

                return 0;

            }

        }

    }

    return 0;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <iostream>

#include <cstring>

#include <cstdio>

#include <cmath>

#include <algorithm>

#include <vector>

using namespace std;

#define fir first

#define sec second

#define pb push_back

#define lowbit(x) ((x)&(-(x))) 



const int maxn = 106; 



int n, o; 

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



int Abs(int x) {

	return x>0?x:-x; 

}



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

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

}



bool check(int X, int Y) {

	int H = D(X,Y,x[o],y[o])+h[o];

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

		if (max(0,H-D(X,Y,x[i],y[i])) != h[i]) return false; 

	return true; 

} 



int main() {

	cin>>n; 

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

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

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

		if (h[i] != 0) o = i; 

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

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

			if (check(X, Y)) {

				cout<<X<<' '<<Y<<' '<<D(X,Y,x[o],y[o])+h[o]<<endl; 

				return 0; 

			}

}


// Optimized solution to the same problem (faster):
#include <cstdio>

int abs(int x) {

    return x > 0 ? x : -x;

}

int n, x[102], y[102], l[102], stdPoint, ansx, ansy, h;

bool check(){

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

        int t=h-abs(ansx-x[i])-abs(ansy-y[i]);

        if(t<0)t=0;

        if(l[i]!=t)return false;

    }

    return true;

}

int main() {

    scanf("%d", &n);

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

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

        if (l[i])

            stdPoint = i;

    }

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

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

            ansx = i, ansy = j;

            h = l[stdPoint] + abs(x[stdPoint] - i) + abs(y[stdPoint] - j);

            if (check()){

                printf("%d %d %d\n",ansx,ansy,h);

                return 0;

            }

        }

    }

    return 0;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
//wrong answer

#include<iostream>

#include<algorithm>



using namespace std;



int abs(int m, int n)

{

	return m - n > 0 ? m - n : n - m;

}



struct data {

	int x;

	int y;

	int h;

}d[105];



int main()

{

	int N, p=0;

	cin >> N;

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

	{

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

	}

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

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

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

		{

			int H = d[p].h + abs(d[p].x, i) + abs(d[p].y, j);

			int l = 0;

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

			{

				if (max(0, H - abs(d[k].x, i) - abs(d[k].y, j)) == d[k].h) l++;

			}

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

			//	cout<<"  *  "<<l<<"   &  "<<N<<endl;

			if (l == N) {

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

				return 0;

			}

		}

	return 0;

}

// Optimized solution to the same problem (faster):
#include <cstdio>

int abs(int x) {

    return x > 0 ? x : -x;

}

int n, x[102], y[102], l[102], stdPoint, ansx, ansy, h;

bool check(){

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

        int t=h-abs(ansx-x[i])-abs(ansy-y[i]);

        if(t<0)t=0;

        if(l[i]!=t)return false;

    }

    return true;

}

int main() {

    scanf("%d", &n);

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

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

        if (l[i])

            stdPoint = i;

    }

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

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

            ansx = i, ansy = j;

            h = l[stdPoint] + abs(x[stdPoint] - i) + abs(y[stdPoint] - j);

            if (check()){

                printf("%d %d %d\n",ansx,ansy,h);

                return 0;

            }

        }

    }

    return 0;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <iostream>

#include <cmath>



using namespace std;



int main()

{

    int N;

    cin >> N;

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



    int i;

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

    {

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

    }



    int j,k,H1,H2,p=0;

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

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

    {

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

    {

        H1 = abs(x[p]-i) + abs(y[p]-j) + h[p];

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

        {

            H2 = H1 - abs(x[k]-i) - abs(y[k]-j);

            if(H2 < 0) H2=0;

            if(H2!=h[k]) break;

        }

        if(k==N) {cout << i << ' ' << j << ' ' << H1;return 0;}

    }

    }



    return 0;

}

// Optimized solution to the same problem (faster):
#include <cstdio>

int abs(int x) {

    return x > 0 ? x : -x;

}

int n, x[102], y[102], l[102], stdPoint, ansx, ansy, h;

bool check(){

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

        int t=h-abs(ansx-x[i])-abs(ansy-y[i]);

        if(t<0)t=0;

        if(l[i]!=t)return false;

    }

    return true;

}

int main() {

    scanf("%d", &n);

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

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

        if (l[i])

            stdPoint = i;

    }

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

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

            ansx = i, ansy = j;

            h = l[stdPoint] + abs(x[stdPoint] - i) + abs(y[stdPoint] - j);

            if (check()){

                printf("%d %d %d\n",ansx,ansy,h);

                return 0;

            }

        }

    }

    return 0;

}

// Fastest known solution for this problem: