static void cf_448B ( String s , String t ) {
  int [ ] arr = new int [ 26 ] ;
  int [ ] arr1 = new int [ 26 ] ;
  for ( int i = 0 ;
  i < s . length ( ) ;
  i ++ ) {
    arr [ s . charAt ( i ) - 'a' ] ++ ;
  }
  for ( int j = 0 ;
  j < t . length ( ) ;
  j ++ ) {
    arr1 [ t . charAt ( j ) - 'a' ] ++ ;
  }
  for ( int i = 0 ;
  i < t . length ( ) ;
  i ++ ) {
    if ( arr [ t . charAt ( i ) - 'a' ] < arr1 [ t . charAt ( i ) - 'a' ] ) {
      System . out . println ( "need tree" ) ;
      return ;
    }
  }
  for ( int i = 0 ;
  ( i + t . length ( ) ) <= s . length ( ) ;
  i ++ ) {
    if ( ( s . substring ( i , i + t . length ( ) ) ) . equals ( t ) ) {
      System . out . println ( "automaton" ) ;
      return ;
    }
  }
  int p1 = 0 ;
  int p2 = 0 ;
  while ( p1 < s . length ( ) && p2 < t . length ( ) ) {
    if ( s . charAt ( p1 ) == t . charAt ( p2 ) ) {
      p2 ++ ;
    }
    p1 ++ ;
  }
  if ( p2 == t . length ( ) ) {
    System . out . println ( "automaton" ) ;
    return ;
  }
  if ( s . length ( ) == t . length ( ) ) {
    System . out . println ( "array" ) ;
    return ;
  }
  System . out . println ( "both" ) ;
}

static void cf_448B ( String s , String t ) { int [ ] arr = new int [ 26 ] ; int [ ] arr1 = new int [ 26 ] ; for ( int i = 0 ; i < s . length ( ) ; i ++ ) { arr [ s . charAt ( i ) - ' a ' ] ++ ; } for ( int j = 0 ; j < t . length ( ) ; j ++ ) { arr1 [ t . charAt ( j ) - ' a ' ] ++ ; } for ( int i = 0 ; i < t . length ( ) ; i ++ ) { if ( arr [ t . charAt ( i ) - ' a ' ] < arr1 [ t . charAt ( i ) - ' a ' ] ) { System . out . println ( " need ▁ tree " ) ; return ; } } for ( int i = 0 ; ( i + t . length ( ) ) <= s . length ( ) ; i ++ ) { if ( ( s . substring ( i , i + t . length ( ) ) ) . equals ( t ) ) { System . out . println ( " automaton " ) ; return ; } } int p1 = 0 ; int p2 = 0 ; while ( p1 < s . length ( ) && p2 < t . length ( ) ) { if ( s . charAt ( p1 ) == t . charAt ( p2 ) ) { p2 ++ ; } p1 ++ ; } if ( p2 == t . length ( ) ) { System . out . println ( " automaton " ) ; return ; } if ( s . length ( ) == t . length ( ) ) { System . out . println ( " array " ) ; return ; } System . out . println ( " both " ) ; }
(method_declaration (modifiers) type: (void_type) name: (identifier) parameters: (formal_parameters (formal_parameter type: (type_identifier) name: (identifier)) (formal_parameter type: (type_identifier) name: (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))))) (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: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list))) update: (update_expression (identifier)) body: (block (expression_statement (update_expression (array_access array: (identifier) index: (binary_expression left: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier))) right: (character_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: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list))) update: (update_expression (identifier)) body: (block (expression_statement (update_expression (array_access array: (identifier) index: (binary_expression left: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier))) right: (character_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: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list))) update: (update_expression (identifier)) body: (block (if_statement condition: (parenthesized_expression (binary_expression left: (array_access array: (identifier) index: (binary_expression left: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier))) right: (character_literal))) right: (array_access array: (identifier) index: (binary_expression left: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier))) right: (character_literal))))) consequence: (block (expression_statement (method_invocation object: (field_access object: (identifier) field: (identifier)) name: (identifier) arguments: (argument_list (string_literal)))) (return_statement))))) (for_statement init: (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal))) condition: (binary_expression left: (parenthesized_expression (binary_expression left: (identifier) right: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)))) right: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list))) update: (update_expression (identifier)) body: (block (if_statement condition: (parenthesized_expression (method_invocation object: (parenthesized_expression (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier) (binary_expression left: (identifier) right: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)))))) name: (identifier) arguments: (argument_list (identifier)))) consequence: (block (expression_statement (method_invocation object: (field_access object: (identifier) field: (identifier)) name: (identifier) arguments: (argument_list (string_literal)))) (return_statement))))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal))) (while_statement condition: (parenthesized_expression (binary_expression left: (binary_expression left: (identifier) right: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list))) right: (binary_expression left: (identifier) right: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list))))) body: (block (if_statement condition: (parenthesized_expression (binary_expression left: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier))) right: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier))))) consequence: (block (expression_statement (update_expression (identifier))))) (expression_statement (update_expression (identifier))))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)))) consequence: (block (expression_statement (method_invocation object: (field_access object: (identifier) field: (identifier)) name: (identifier) arguments: (argument_list (string_literal)))) (return_statement))) (if_statement condition: (parenthesized_expression (binary_expression left: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)) right: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)))) consequence: (block (expression_statement (method_invocation object: (field_access object: (identifier) field: (identifier)) name: (identifier) arguments: (argument_list (string_literal)))) (return_statement))) (expression_statement (method_invocation object: (field_access object: (identifier) field: (identifier)) name: (identifier) arguments: (argument_list (string_literal))))))