static String first_subString ( String s ) {
  int n = s . length ( ) , c = 0 ;
  String s1 , s2 ;
  HashMap < String , Integer > mpp = new HashMap < String , Integer > ( ) ;
  for ( int i = 0 ;
  i < n ;
  i ++ ) {
    if ( s . charAt ( i ) == ' ' || s . charAt ( i ) == '#' ) {
      s1 = s . substring ( c , i ) ;
      mpp . put ( s1 , 1 ) ;
      c = i + 1 ;
    }
  }
  for ( int i = 0 ;
  i < n ;
  i ++ ) {
    if ( s . charAt ( i ) == ' ' ) {
      continue ;
    }
    for ( int j = 0 ;
    j < n ;
    j ++ ) {
      if ( s . charAt ( i ) == ' ' ) {
        break ;
      }
      s1 = s . substring ( i , j - i + 1 ) ;
      s2 = s1 ;
      s1 = reverse ( s1 ) ;
      if ( mpp . containsKey ( s1 ) ) {
        return s2 ;
      }
    }
  }
  return "-1" ;
}

static String first_subString ( String s ) { int n = s . length ( ) , c = 0 ; String s1 , s2 ; HashMap < String , Integer > mpp = new HashMap < String , Integer > ( ) ; for ( int i = 0 ; i < n ; i ++ ) { if ( s . charAt ( i ) == ' ▁ ' || s . charAt ( i ) == ' # ' ) { s1 = s . substring ( c , i ) ; mpp . put ( s1 , 1 ) ; c = i + 1 ; } } for ( int i = 0 ; i < n ; i ++ ) { if ( s . charAt ( i ) == ' ▁ ' ) { continue ; } for ( int j = 0 ; j < n ; j ++ ) { if ( s . charAt ( i ) == ' ▁ ' ) { break ; } s1 = s . substring ( i , j - i + 1 ) ; s2 = s1 ; s1 = reverse ( s1 ) ; if ( mpp . containsKey ( s1 ) ) { return s2 ; } } } return " - 1" ; }
(method_declaration (modifiers) type: (type_identifier) name: (identifier) parameters: (formal_parameters (formal_parameter type: (type_identifier) name: (identifier))) body: (block (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: (decimal_integer_literal))) (local_variable_declaration type: (type_identifier) declarator: (variable_declarator name: (identifier)) declarator: (variable_declarator name: (identifier))) (local_variable_declaration type: (generic_type (type_identifier) (type_arguments (type_identifier) (type_identifier))) declarator: (variable_declarator name: (identifier) value: (object_creation_expression type: (generic_type (type_identifier) (type_arguments (type_identifier) (type_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 (if_statement condition: (parenthesized_expression (binary_expression left: (binary_expression left: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier))) right: (character_literal)) right: (binary_expression left: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier))) right: (character_literal)))) consequence: (block (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 (identifier) (decimal_integer_literal)))) (expression_statement (assignment_expression left: (identifier) right: (binary_expression left: (identifier) right: (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: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier))) right: (character_literal))) consequence: (block (continue_statement))) (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: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier))) right: (character_literal))) consequence: (block (break_statement))) (expression_statement (assignment_expression left: (identifier) right: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier) (binary_expression left: (binary_expression left: (identifier) right: (identifier)) right: (decimal_integer_literal)))))) (expression_statement (assignment_expression left: (identifier) right: (identifier))) (expression_statement (assignment_expression left: (identifier) right: (method_invocation name: (identifier) arguments: (argument_list (identifier))))) (if_statement condition: (parenthesized_expression (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier)))) consequence: (block (return_statement (identifier)))))))) (return_statement (string_literal))))