function gets(str){
  this._s = str.split("\n");
  this._y = 0;
};
gets.prototype = {
  a: function(f){
    var s = this._s, y = this._y, r;
    if(typeof s[y] === "string")s[y] = s[y].split(" ").reverse();
    r = s[y].pop();
    if(!s[y].length)this._y++;
    return f?r:+r;
  },
  l: function(f){
    var s = this._s[this._y++].split(" ");
    return f?s:s.map(a=>+a);
  },
  m: function(n,f){
    var s = this._s, y = this._y, r = [], i = 0;
    if(f)for(;i < n; i++)r[i] = s[y+i].split(" ");
    else for(;i < n; i++)r[i] = s[y+i].split(" ").map(a=>+a);
    this._y += n;
    return r;
  },
};
var o=new gets(require("fs").readFileSync("/dev/stdin","utf8"));

console.log(main());
function main(){
  var n = o.a();
  var x = o.m(n);
  var a = Array(101).fill(0).map(a=>[]);
  var b = [];
  for(var i = 0; i <= 100; i++)for(var j = 0; j <= 100; j++){
    a[i][j] = x[0][2] + Math.abs(x[0][1] - i) + Math.abs(x[0][0] - j);
    b.push(i*1000+j);
  }
  for(i = 1; i < n; i++)for(j = b.length-1; j >= 0 && b.length > 1; j--){
    var u = b[j]/1000|0, v = b[j]%1000;
    if(a[v][u] !== x[i][2] + Math.abs(x[i][1] - v) + Math.abs(x[i][0] - u)){
      var t = b[j]; b[j] = b[b.length-1];b.pop();
    }
  }
  return (b[0]/1000|0) + " " + (b[0]%1000) + " " + a[b[0]%1000][b[0]/1000|0];
}