unittest
{
	assert( [ "4", "2 3 5", "2 1 5", "1 2 5", "3 2 5" ].parse.expand.solve == "2 2 6" );
	assert( [ "2", "0 0 100", "1 1 98" ].parse.expand.solve == "0 0 100" );
	assert( [ "3", "99 1 191", "100 1 192", "99 0 192" ].parse.expand.solve == "100 0 193" );
}



import std.algorithm;
import std.conv;
import std.math;
import std.range;
import std.stdio;
import std.string;
import std.typecons;

void main()
{
	stdin.byLineCopy.parse.expand.solve.writeln;
}

auto parse( Range )( Range input )
if( isInputRange!Range && is( ElementType!Range == string ) )
{
	auto n = input.front.strip.to!( long );
	auto xyhs = new long[ 3 ][ n ];
	foreach( ref xyh; xyhs )
	{
		input.popFront;
		xyh = input.front.split.to!( long[] );
	}
	return tuple( xyhs );
}

auto solve( long[ 3 ][] xyhs )
{
	foreach( cx; 0 .. 101 )
	{
		LOOP: foreach( cy; 0 .. 101 )
		{
			// 高さが0より大きくなるやつで仮の高さを決める
			auto ch = 0L;
			foreach( xyh; xyhs )
			{
				if( 0 < xyh[ 2 ] )
				{
					// max( ch - ( x - cx ).abs - ( y - cy ).abs, 0 ) == h
					// -->  ch == h + ( y - cy ).abs + ( x - cx ).abs
					auto ch_t = xyh[ 2 ] + ( xyh[ 0 ] - cx ).abs + ( xyh[ 1 ] - cy ).abs;
					if( ch_t != 0 )
					{
						ch = ch_t;
						break;
					}
				}
			}
			if( ch == 0 ) continue LOOP;
			
			// 仮の高さが全部に当てはまるか判定
			foreach( xyh; xyhs )
			{
				if( max( ch - ( xyh[ 0 ] - cx ).abs - ( xyh[ 1 ] - cy ).abs, 0 ) != xyh[ 2 ] ) continue LOOP;
			}
			return format("%d %d %d", cx, cy, ch );
		}
	}
	
	assert( false );
}
