unittest
{
	assert( [ "4", "2 3 5", "2 1 5", "1 2 5", "3 2 5" ].solve == "2 2 6" );
	assert( [ "2", "0 0 100", "1 1 98" ].solve == "0 0 100" );
	assert( [ "3", "99 1 191", "100 1 192", "99 0 192" ].solve == "100 0 193" );
	
	assert( [ "5", "100 100 0", "2 3 5", "2 1 5", "1 2 5", "3 2 5" ].solve == "2 2 6" );		// 追加ケース
}



import std.algorithm;
import std.conv;
import std.format;
import std.math;
import std.range;
import std.stdio;

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

auto solve( Range )( Range input )
if( isInputRange!Range && is( ElementType!Range == string ) )
{
	auto n = input.front.to!( long );
	auto xyhs = new long[ 3 ][ n ];
	foreach( ref xyh; xyhs )
	{
		input.popFront;
		xyh = input.front.split.to!( long[] );
	}
	xyhs.sort!( ( a, b ) => b[ 2 ] < a[ 2 ] );
	
	foreach( cx; 0L .. 101L )
	{
		LOOP: foreach( cy; 0L .. 101L )
		{
			auto ch = xyhs.front[ 2 ] + abs( xyhs.front[ 0 ] - cx ) + abs( xyhs.front[ 1 ] - cy );
			foreach( xyh; xyhs )
			{
				if( max( ch - abs( xyh[ 0 ] - cx ) - abs( xyh[ 1 ] - cy ), 0 ) != xyh[ 2 ] ) continue LOOP;
			}
			return format( "%s %s %s", cx, cy, ch );
		}
	}
	assert( false );
}
