static String getGoodString ( String ss , int n ) {
  char [ ] s = ss . toCharArray ( ) ;
  if ( n < 26 ) return "-1" ;
  int [ ] cnt = new int [ 27 ] ;
  for ( int i = 25 ;
  i < n ;
  i ++ ) {
    for ( int j = i ;
    j >= i - 25 ;
    j -- ) {
      if ( s [ j ] != '?' ) cnt [ ( ( int ) s [ j ] - ( int ) 'a' ) ] ++ ;
    }
    if ( valid ( cnt ) ) {
      int cur = 0 ;
      while ( cnt [ cur ] > 0 ) cur ++ ;
      for ( int j = i - 25 ;
      j <= i ;
      j ++ ) {
        if ( s [ j ] == '?' ) {
          s [ j ] = ( char ) ( cur + ( int ) ( 'a' ) ) ;
          cur ++ ;
          while ( cnt [ cur ] > 0 ) cur ++ ;
        }
      }
      return new String ( s ) ;
    }
  }
  return "-1" ;
}

static String getGoodString ( String ss , int n ) { char [ ] s = ss . toCharArray ( ) ; if ( n < 26 ) return " - 1" ; int [ ] cnt = new int [ 27 ] ; for ( int i = 25 ; i < n ; i ++ ) { for ( int j = i ; j >= i - 25 ; j -- ) { if ( s [ j ] != ' ? ' ) cnt [ ( ( int ) s [ j ] - ( int ) ' a ' ) ] ++ ; } if ( valid ( cnt ) ) { int cur = 0 ; while ( cnt [ cur ] > 0 ) cur ++ ; for ( int j = i - 25 ; j <= i ; j ++ ) { if ( s [ j ] == ' ? ' ) { s [ j ] = ( char ) ( cur + ( int ) ( ' a ' ) ) ; cur ++ ; while ( cnt [ cur ] > 0 ) cur ++ ; } } return new String ( s ) ; } } return " - 1" ; }
(method_declaration (modifiers) type: (type_identifier) name: (identifier) parameters: (formal_parameters (formal_parameter type: (type_identifier) name: (identifier)) (formal_parameter type: (integral_type) name: (identifier))) body: (block (local_variable_declaration type: (array_type element: (integral_type) dimensions: (dimensions)) declarator: (variable_declarator name: (identifier) value: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (decimal_integer_literal))) consequence: (return_statement (string_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))))) (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 (for_statement init: (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (identifier))) condition: (binary_expression left: (identifier) right: (binary_expression left: (identifier) right: (decimal_integer_literal))) update: (update_expression (identifier)) body: (block (if_statement condition: (parenthesized_expression (binary_expression left: (array_access array: (identifier) index: (identifier)) right: (character_literal))) consequence: (expression_statement (update_expression (array_access array: (identifier) index: (parenthesized_expression (binary_expression left: (cast_expression type: (integral_type) value: (array_access array: (identifier) index: (identifier))) right: (cast_expression type: (integral_type) value: (character_literal)))))))))) (if_statement condition: (parenthesized_expression (method_invocation name: (identifier) arguments: (argument_list (identifier)))) consequence: (block (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal))) (while_statement condition: (parenthesized_expression (binary_expression left: (array_access array: (identifier) index: (identifier)) right: (decimal_integer_literal))) body: (expression_statement (update_expression (identifier)))) (for_statement init: (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (binary_expression left: (identifier) right: (decimal_integer_literal)))) condition: (binary_expression left: (identifier) right: (identifier)) update: (update_expression (identifier)) body: (block (if_statement condition: (parenthesized_expression (binary_expression left: (array_access array: (identifier) index: (identifier)) right: (character_literal))) consequence: (block (expression_statement (assignment_expression left: (array_access array: (identifier) index: (identifier)) right: (cast_expression type: (integral_type) value: (parenthesized_expression (binary_expression left: (identifier) right: (cast_expression type: (integral_type) value: (parenthesized_expression (character_literal)))))))) (expression_statement (update_expression (identifier))) (while_statement condition: (parenthesized_expression (binary_expression left: (array_access array: (identifier) index: (identifier)) right: (decimal_integer_literal))) body: (expression_statement (update_expression (identifier)))))))) (return_statement (object_creation_expression type: (type_identifier) arguments: (argument_list (identifier)))))))) (return_statement (string_literal))))