public static void main ( String args [ ] ) throws Exception {
  Scanner in = new Scanner ( System . in ) ;
  PrintWriter out = new PrintWriter ( System . out ) ;
  int tcnt = in . nextInt ( ) ;
  for ( int i = 1 ;
  i <= tcnt ;
  i ++ ) {
    int n = in . nextInt ( ) ;
    Pt [ ] p = new Pt [ n ] ;
    for ( int j = 0 ;
    j < n ;
    j ++ ) {
      int a = in . nextInt ( ) ;
      int b = in . nextInt ( ) ;
      int c = in . nextInt ( ) ;
      p [ j ] = new Pt ( a , b , c ) ;
    };
    Arrays . sort ( p ) ;
    int mx = 0 ;
    for ( int x = 0 ;
    x <= 10000 ;
    x ++ ) {
      int [ ] T = new int [ 10002 ] ;
      for ( int j = 0 ;
      j < n ;
      j ++ ) {
        if ( p [ j ] . x <= x ) {
          int z = 10000 - p [ j ] . y - x ;
          for ( int k = 1 + p [ j ] . z ;
          k <= 10001 ;
          k += k & - k ) T [ k ] ++ ;
          if ( z >= 0 ) {
            int sum = 0 ;
            for ( int k = 1 + Math . max ( 0 , z ) ;
            k > 0 ;
            k -= k & - k ) sum += T [ k ] ;
            mx = Math . max ( mx , sum ) ;
          };
        };
      };
    };
    out . println ( "Case #" + i + ": " + mx ) ;
  };
  out . close ( ) ;
}

public static void main ( String args [ ] ) throws Exception { Scanner in = new Scanner ( System . in ) ; PrintWriter out = new PrintWriter ( System . out ) ; int tcnt = in . nextInt ( ) ; for ( int i = 1 ; i <= tcnt ; i ++ ) { int n = in . nextInt ( ) ; Pt [ ] p = new Pt [ n ] ; for ( int j = 0 ; j < n ; j ++ ) { int a = in . nextInt ( ) ; int b = in . nextInt ( ) ; int c = in . nextInt ( ) ; p [ j ] = new Pt ( a , b , c ) ; } ; Arrays . sort ( p ) ; int mx = 0 ; for ( int x = 0 ; x <= 10000 ; x ++ ) { int [ ] T = new int [ 10002 ] ; for ( int j = 0 ; j < n ; j ++ ) { if ( p [ j ] . x <= x ) { int z = 10000 - p [ j ] . y - x ; for ( int k = 1 + p [ j ] . z ; k <= 10001 ; k += k & - k ) T [ k ] ++ ; if ( z >= 0 ) { int sum = 0 ; for ( int k = 1 + Math . max ( 0 , z ) ; k > 0 ; k -= k & - k ) sum += T [ k ] ; mx = Math . max ( mx , sum ) ; } ; } ; } ; } ; out . println ( " Case ▁ # " + i + " : ▁ " + mx ) ; } ; out . close ( ) ; }
(method_declaration (modifiers) type: (void_type) name: (identifier) parameters: (formal_parameters (formal_parameter type: (type_identifier) name: (identifier) dimensions: (dimensions))) (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: (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)))) (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 (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 (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: (integral_type) declarator: (variable_declarator name: (identifier) value: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)))) (expression_statement (assignment_expression left: (array_access array: (identifier) index: (identifier)) right: (object_creation_expression type: (type_identifier) arguments: (argument_list (identifier) (identifier) (identifier))))))) (expression_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier)))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal))) (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: (array_type element: (integral_type) dimensions: (dimensions)) declarator: (variable_declarator name: (identifier) value: (array_creation_expression type: (integral_type) dimensions: (dimensions_expr (decimal_integer_literal))))) (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: (identifier))) consequence: (block (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (binary_expression left: (binary_expression left: (decimal_integer_literal) right: (field_access object: (array_access array: (identifier) index: (identifier)) field: (identifier))) right: (identifier)))) (for_statement init: (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (binary_expression left: (decimal_integer_literal) right: (field_access object: (array_access array: (identifier) index: (identifier)) field: (identifier))))) condition: (binary_expression left: (identifier) right: (decimal_integer_literal)) update: (assignment_expression left: (identifier) right: (binary_expression left: (identifier) right: (unary_expression operand: (identifier)))) body: (expression_statement (update_expression (array_access array: (identifier) index: (identifier))))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (decimal_integer_literal))) consequence: (block (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal))) (for_statement init: (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (binary_expression left: (decimal_integer_literal) right: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (decimal_integer_literal) (identifier)))))) condition: (binary_expression left: (identifier) right: (decimal_integer_literal)) update: (assignment_expression left: (identifier) right: (binary_expression left: (identifier) right: (unary_expression operand: (identifier)))) body: (expression_statement (assignment_expression left: (identifier) right: (array_access array: (identifier) index: (identifier))))) (expression_statement (assignment_expression left: (identifier) right: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier) (identifier))))))))))))) (expression_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (binary_expression left: (binary_expression left: (binary_expression left: (string_literal) right: (identifier)) right: (string_literal)) right: (identifier))))))) (expression_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)))))