public static String solve ( ) {
  String out = "" ;
  int a = in . nextInt ( ) , b = in . nextInt ( ) , c = in . nextInt ( ) , limit = in . nextInt ( ) ;
  int [ ] abT = new int [ 201 ] ;
  int [ ] bcT = new int [ 201 ] ;
  int [ ] acT = new int [ 201 ] ;
  int count = 0 ;
  for ( int i = a ;
  i >= 1 ;
  i -- ) {
    for ( int j = b ;
    j >= 1 ;
    j -- ) {
      for ( int kk = c ;
      kk >= 1 ;
      kk -- ) {
        int k = ( kk + ( i ) + ( j ) ) % c ;
        k ++ ;
        int ab = i * 15 + j ;
        int ac = i * 15 + k ;
        int bc = j * 15 + k ;
        if ( abT [ ab ] < limit && bcT [ bc ] < limit && acT [ ac ] < limit ) {
          out += "\n" + i + " " + j + " " + k ;
          count ++ ;
          abT [ ab ] ++ ;
          bcT [ bc ] ++ ;
          acT [ ac ] ++ ;
        }
        else {
        }
      }
    }
  }
  System . err . println ( count ) ;
  return count + "" + out ;
}

public static String solve ( ) { String out = " " ; int a = in . nextInt ( ) , b = in . nextInt ( ) , c = in . nextInt ( ) , limit = in . nextInt ( ) ; int [ ] abT = new int [ 201 ] ; int [ ] bcT = new int [ 201 ] ; int [ ] acT = new int [ 201 ] ; int count = 0 ; for ( int i = a ; i >= 1 ; i -- ) { for ( int j = b ; j >= 1 ; j -- ) { for ( int kk = c ; kk >= 1 ; kk -- ) { int k = ( kk + ( i ) + ( j ) ) % c ; k ++ ; int ab = i * 15 + j ; int ac = i * 15 + k ; int bc = j * 15 + k ; if ( abT [ ab ] < limit && bcT [ bc ] < limit && acT [ ac ] < limit ) { out += " \n " + i + " ▁ " + j + " ▁ " + k ; count ++ ; abT [ ab ] ++ ; bcT [ bc ] ++ ; acT [ ac ] ++ ; } else { } } } } System . err . println ( count ) ; return count + " " + out ; }
(method_declaration (modifiers) type: (type_identifier) name: (identifier) parameters: (formal_parameters) body: (block (local_variable_declaration type: (type_identifier) declarator: (variable_declarator name: (identifier) value: (string_literal))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list))) declarator: (variable_declarator name: (identifier) value: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list))) declarator: (variable_declarator name: (identifier) value: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list))) declarator: (variable_declarator name: (identifier) value: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)))) (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))))) (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))))) (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))))) (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: (identifier))) 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: (identifier))) 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: (identifier))) 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: (binary_expression left: (parenthesized_expression (binary_expression left: (binary_expression left: (identifier) right: (parenthesized_expression (identifier))) right: (parenthesized_expression (identifier)))) right: (identifier)))) (expression_statement (update_expression (identifier))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (binary_expression left: (binary_expression left: (identifier) right: (decimal_integer_literal)) right: (identifier)))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (binary_expression left: (binary_expression left: (identifier) right: (decimal_integer_literal)) right: (identifier)))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (binary_expression left: (binary_expression left: (identifier) right: (decimal_integer_literal)) right: (identifier)))) (if_statement condition: (parenthesized_expression (binary_expression left: (binary_expression left: (binary_expression left: (array_access array: (identifier) index: (identifier)) right: (identifier)) right: (binary_expression left: (array_access array: (identifier) index: (identifier)) right: (identifier))) right: (binary_expression left: (array_access array: (identifier) index: (identifier)) right: (identifier)))) consequence: (block (expression_statement (assignment_expression left: (identifier) right: (binary_expression left: (binary_expression left: (binary_expression left: (binary_expression left: (binary_expression left: (string_literal) right: (identifier)) right: (string_literal)) right: (identifier)) right: (string_literal)) right: (identifier)))) (expression_statement (update_expression (identifier))) (expression_statement (update_expression (array_access array: (identifier) index: (identifier)))) (expression_statement (update_expression (array_access array: (identifier) index: (identifier)))) (expression_statement (update_expression (array_access array: (identifier) index: (identifier))))) alternative: (block)))))))) (expression_statement (method_invocation object: (field_access object: (identifier) field: (identifier)) name: (identifier) arguments: (argument_list (identifier)))) (return_statement (binary_expression left: (binary_expression left: (identifier) right: (string_literal)) right: (identifier)))))