#include<iostream>
#include<vector>
#include<cmath>
#include<algorithm>

int main(){
  int N;
  std::cin >> N;
  std::vector<std::vector<long>> coord(N, std::vector<long>(3));
  for(int i = 0; i < N; i++) std::cin >> coord[i][0] >> coord[i][1] >> coord[i][2];
  std::sort(coord.begin(), coord.end());

  // for(int i = 0; i < N; i++) std::cout << coord[i][0] << " " << coord[i][1] << " " << coord[i][2] << std::endl;

  std::vector<std::vector<std::pair<int,long>>> centH0(101, std::vector<std::pair<int,long>>(101));
  for(int i = 0; i < 101; i++){
    for(int j = 0; j < 101; j++){
      long th = std::abs(i-coord[0][0])+std::abs(j-coord[0][1])+coord[0][2];
      int flag = 0;
      if(coord[0][2] > 0) flag = 1;
      centH0[i][j] = std::make_pair(flag, th);
    }
  }

  // for(int i = 0; i < 100; i++){
  //   for(int j = 0; j < 100; j++){
  //     std::cout << centH0[i][j].second << " ";
  //   }
  //   std::cout << std::endl;
  // }

  std::vector< std::pair<std::pair<int, int>, std::pair<int,long>> > centH;
  int base=N-1;
  while(base != 0){
    if(coord[base][2] == 0) base--;
    else break;
  }
  if(base == 0) base = N-1;

  for(int i = 0; i < 101; i++){
    for(int j = 0; j < 101; j++){
      long th = std::abs(i-coord[base][0])+std::abs(j-coord[base][1])+coord[base][2];
      int flag = 0;
      if(coord[base][2] > 0) flag = 1;
      if(centH0[i][j].first == 0){
        if(flag == 0) centH.push_back(
                      std::make_pair( std::make_pair(i,j),
                                      std::make_pair(flag, std::min(centH0[i][j].second, th)) )
                      );
        else{
          if(th <= centH0[i][j].second) centH.push_back(
                                        std::make_pair( std::make_pair(i,j),
                                                        std::make_pair(flag, th) )
                                         );
        }
      }else{
        if(flag == 0){
          if(th >= centH0[i][j].second) centH.push_back(
                                        std::make_pair( std::make_pair(i,j),
                                                        centH0[i][j] )
                                        );
        }else{
          if(th == centH0[i][j].second) centH.push_back(
                                        std::make_pair( std::make_pair(i,j),
                                                        centH0[i][j] )
                                        );
        }
      }
    }//j
  }//i

  // for(int i = 0; i < centH.size(); i++){
  //   std::cout << "("<<centH[i].first.first << ", "<< centH[i].first.second << "), flag = "
  //             << centH[i].second.first << ", h = " << centH[i].second.first << std::endl;
  // }

  for(int i = 1; i < N; i++){
    if(i == base) continue;
    for(int j = 0; j < centH.size(); j++){
      long th = std::abs(centH[j].first.first-coord[i][0])+
                std::abs(centH[j].first.second-coord[i][1])+coord[i][2];
      int flag = 0;
      if(coord[i][2] > 1) flag = 1;
      if(centH[j].second.first == 0){
        if(flag == 0) centH[j].second.second = std::min(centH[j].second.second, th);
        else{
          if(th <= centH[j].second.second) centH[j].second = std::make_pair(flag, th);
          else centH[j].second.first = -1;
        }
      }else{
        if(flag == 0){
          if(th < centH[j].second.second) centH[j].second.first = -1;
        }else{
          if(th != centH[j].second.second) centH[j].second.first = -1;
        }
      }
    }//j
  }//i
  bool check = true;
  for(int i = 0; i < centH.size(); i++){
    if(centH[i].second.first == 1){
      std::cout << centH[i].first.first << " "
                << centH[i].first.second << " "
                << centH[i].second.second << std::endl;
      check = false;
      break;
    }
  }
  if(check){
    for(int i = 0; i < centH.size(); i++){
      if(centH[i].second.second > 0) std::cout << centH[i].first.first << " "
                                               << centH[i].first.second << " "
                                               << centH[i].second.second << std::endl;
    }
  }
}


Measured memory_bytes: 964