public static void main ( String [ ] args ) throws Exception {
  Scanner sc = new Scanner ( System . in ) ;
  int n = sc . nextInt ( ) ;
  Point [ ] points = new Point [ n ] ;
  for ( int i = 0 ;
  i < n ;
  i ++ ) {
    points [ i ] = new Point ( sc . nextInt ( ) , sc . nextInt ( ) , sc . nextInt ( ) ) ;
  }
  sc . close ( ) ;
  int ansX = - 1 ;
  int ansY = - 1 ;
  int ansH = - 1 ;
  label : for ( int x = 0 ;
  x < 101 ;
  x ++ ) {
    for ( int y = 0 ;
    y < 101 ;
    y ++ ) {
      int baseH = - 1 ;
      boolean flg = true ;
      for ( int i = 0 ;
      i < n ;
      i ++ ) {
        if ( points [ i ] . h > 0 ) {
          int h = points [ i ] . h + Math . abs ( x - points [ i ] . x ) + Math . abs ( y - points [ i ] . y ) ;
          if ( baseH == - 1 ) {
            baseH = h ;
          }
          else if ( baseH != h ) {
            flg = false ;
            break ;
          }
        }
      }
      if ( flg ) {
        for ( int i = 0 ;
        i < n ;
        i ++ ) {
          if ( points [ i ] . h == 0 ) {
            if ( baseH > Math . abs ( x - points [ i ] . x ) + Math . abs ( y - points [ i ] . y ) ) {
              flg = false ;
              break ;
            }
          }
        }
        if ( ! flg ) {
          continue ;
        }
        ansX = x ;
        ansY = y ;
        ansH = baseH ;
        break label ;
      }
    }
  }
  System . out . println ( ansX + " " + ansY + " " + ansH ) ;
}

public static void main ( String [ ] args ) throws Exception { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; Point [ ] points = new Point [ n ] ; for ( int i = 0 ; i < n ; i ++ ) { points [ i ] = new Point ( sc . nextInt ( ) , sc . nextInt ( ) , sc . nextInt ( ) ) ; } sc . close ( ) ; int ansX = - 1 ; int ansY = - 1 ; int ansH = - 1 ; label : for ( int x = 0 ; x < 101 ; x ++ ) { for ( int y = 0 ; y < 101 ; y ++ ) { int baseH = - 1 ; boolean flg = true ; for ( int i = 0 ; i < n ; i ++ ) { if ( points [ i ] . h > 0 ) { int h = points [ i ] . h + Math . abs ( x - points [ i ] . x ) + Math . abs ( y - points [ i ] . y ) ; if ( baseH == - 1 ) { baseH = h ; } else if ( baseH != h ) { flg = false ; break ; } } } if ( flg ) { for ( int i = 0 ; i < n ; i ++ ) { if ( points [ i ] . h == 0 ) { if ( baseH > Math . abs ( x - points [ i ] . x ) + Math . abs ( y - points [ i ] . y ) ) { flg = false ; break ; } } } if ( ! flg ) { continue ; } ansX = x ; ansY = y ; ansH = baseH ; break label ; } } } System . out . println ( ansX + " ▁ " + ansY + " ▁ " + ansH ) ; }
(method_declaration (modifiers) type: (void_type) name: (identifier) parameters: (formal_parameters (formal_parameter type: (array_type element: (type_identifier) dimensions: (dimensions)) name: (identifier))) (throws (type_identifier)) body: (block (local_variable_declaration type: (type_identifier) declarator: (variable_declarator name: (identifier) value: (object_creation_expression type: (type_identifier) arguments: (argument_list (field_access object: (identifier) field: (identifier)))))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)))) (local_variable_declaration type: (array_type element: (type_identifier) dimensions: (dimensions)) declarator: (variable_declarator name: (identifier) value: (array_creation_expression type: (type_identifier) dimensions: (dimensions_expr (identifier))))) (for_statement init: (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal))) condition: (binary_expression left: (identifier) right: (identifier)) update: (update_expression (identifier)) body: (block (expression_statement (assignment_expression left: (array_access array: (identifier) index: (identifier)) right: (object_creation_expression type: (type_identifier) arguments: (argument_list (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)) (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)) (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)))))))) (expression_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (unary_expression operand: (decimal_integer_literal)))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (unary_expression operand: (decimal_integer_literal)))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (unary_expression operand: (decimal_integer_literal)))) (labeled_statement (identifier) (for_statement init: (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal))) condition: (binary_expression left: (identifier) right: (decimal_integer_literal)) update: (update_expression (identifier)) body: (block (for_statement init: (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal))) condition: (binary_expression left: (identifier) right: (decimal_integer_literal)) update: (update_expression (identifier)) body: (block (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (unary_expression operand: (decimal_integer_literal)))) (local_variable_declaration type: (boolean_type) declarator: (variable_declarator name: (identifier) value: (true))) (for_statement init: (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal))) condition: (binary_expression left: (identifier) right: (identifier)) update: (update_expression (identifier)) body: (block (if_statement condition: (parenthesized_expression (binary_expression left: (field_access object: (array_access array: (identifier) index: (identifier)) field: (identifier)) right: (decimal_integer_literal))) consequence: (block (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (binary_expression left: (binary_expression left: (field_access object: (array_access array: (identifier) index: (identifier)) field: (identifier)) right: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (binary_expression left: (identifier) right: (field_access object: (array_access array: (identifier) index: (identifier)) field: (identifier)))))) right: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (binary_expression left: (identifier) right: (field_access object: (array_access array: (identifier) index: (identifier)) field: (identifier)))))))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (unary_expression operand: (decimal_integer_literal)))) consequence: (block (expression_statement (assignment_expression left: (identifier) right: (identifier)))) alternative: (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (identifier))) consequence: (block (expression_statement (assignment_expression left: (identifier) right: (false))) (break_statement)))))))) (if_statement condition: (parenthesized_expression (identifier)) consequence: (block (for_statement init: (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal))) condition: (binary_expression left: (identifier) right: (identifier)) update: (update_expression (identifier)) body: (block (if_statement condition: (parenthesized_expression (binary_expression left: (field_access object: (array_access array: (identifier) index: (identifier)) field: (identifier)) right: (decimal_integer_literal))) consequence: (block (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (binary_expression left: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (binary_expression left: (identifier) right: (field_access object: (array_access array: (identifier) index: (identifier)) field: (identifier))))) right: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (binary_expression left: (identifier) right: (field_access object: (array_access array: (identifier) index: (identifier)) field: (identifier)))))))) consequence: (block (expression_statement (assignment_expression left: (identifier) right: (false))) (break_statement))))))) (if_statement condition: (parenthesized_expression (unary_expression operand: (identifier))) consequence: (block (continue_statement))) (expression_statement (assignment_expression left: (identifier) right: (identifier))) (expression_statement (assignment_expression left: (identifier) right: (identifier))) (expression_statement (assignment_expression left: (identifier) right: (identifier))) (break_statement (identifier))))))))) (expression_statement (method_invocation object: (field_access object: (identifier) field: (identifier)) name: (identifier) arguments: (argument_list (binary_expression left: (binary_expression left: (binary_expression left: (binary_expression left: (identifier) right: (string_literal)) right: (identifier)) right: (string_literal)) right: (identifier)))))))