// Original C++ solution (slower):
#include<bits/stdc++.h>

using namespace std;



typedef long long lint;

#define REP(i, x, n) for(lint i = x ; i < n ; i++)

#define rep(i, n) REP(i, 0, n)

#define repr(i, n) for(lint i = n - 1 ; i >= 0 ; i--)

#define SORT(c) sort((c).begin(), (c).end())



const int IINF = 1e9 + 10;

const lint LLINF = (lint)1e18 + 10;

const lint MOD = (lint)1e9 + 7;

const lint inv = MOD - 2;

const int dx[] = {1, 0, -1, 0}, dy[] = {0, 1, 0, -1};

const int dx8[] = {1, 1, 0, -1, -1, -1, 0, 1}, dy8[] = {0, -1, -1, -1, 0, 1, 1, 1};



int main(){

    int n;

    cin >> n;

    vector<int> x(n), y(n), h(n);

    int minH = IINF, maxH = 1;

    rep(i, n){

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

        minH = min(minH, h[i]);

        maxH = max(maxH, h[i]);

    }

    minH = max(minH, 1);

    maxH += 201;

    int ansx, ansy, ansh;

    rep(cx, 101){

        bool flag = false;

        rep(cy, 101){

            REP(H, minH, maxH){

                flag = true;

                rep(i, n){

                    int tmp = H - abs(x[i] - cx) - abs(y[i] - cy);

                    if(h[i] == 0){

                        if(tmp > 0){

                            flag = false;

                            break;

                        }

                    }else{

                        if(tmp != h[i]){

                            flag = false;

                            break;

                        }

                    }

                }

                if(flag){

                    ansx = cx;

                    ansy = cy;

                    ansh = H;

                    break;

                }

            }

            if(flag){

                break;

            }

        }

        if(flag){

            break;

        }

    }

    cout << ansx << " " << ansy << " " << ansh << endl;

    return 0;

}

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

using namespace std;



typedef long long lint;

typedef pair<int, int> P;

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

#define rep(i, n) REP(i, 0, n)

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

#define SORT(c) sort((c).begin(), (c).end())



const int IINF = 1e9 + 10;

const lint LLINF = (lint)1e18 + 10;

const lint MOD = (lint)1e9 + 7;

const int dx[] = {1, 0, -1, 0}, dy[] = {0, 1, 0, -1};

const int dx8[] = {1, 1, 0, -1, -1, -1, 0, 1}, dy8[] = {0, -1, -1, -1, 0, 1, 1, 1};



int main(){

    int n;

    cin >> n;

    vector<int> x(n), y(n), h(n);

    int k = 0;

    rep(i, n){

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

        if(h[i] > 0){

            k = i;

        }

    }

    int ans1, ans2, ans3;

    bool flag = false;

    rep(cx, 101){

        rep(cy, 101){

            ans1 = cx;

            ans2 = cy;

            ans3 = h[k] + abs(x[k] - cx) + abs(y[k] - cy);

            flag = true;

            rep(i, n){

                if(h[i] != max(ans3 - abs(x[i] - cx) - abs(y[i] - cy), 0)){

                    flag = false;

                    break;

                }

            }

            if(flag) break;

        }

        if(flag) break;

    }

    printf("%d %d %d\n", ans1, ans2, ans3);

    return 0;

}

// Fastest known solution for this problem: