public static char abc_ans ( String str_a , String str_b , String str_c ) {
  char [ ] a = str_a . toCharArray ( ) ;
  char [ ] b = str_b . toCharArray ( ) ;
  char [ ] c = str_c . toCharArray ( ) ;
  int a_count = a . length ;
  int b_count = b . length ;
  int c_count = c . length ;
  int a_number = 0 ;
  int b_number = 0 ;
  int c_number = 0 ;
  char x = a [ a_number ] ;
  while ( true ) {
    switch ( x ) {
      case 'a' : if ( a_number >= a . length ) {
        return ( 'A' ) ;
      }
      x = a [ a_number ] ;
      a_number ++ ;
      break ;
      case 'b' : if ( b_number >= b . length ) {
        return ( 'B' ) ;
      }
      x = b [ b_number ] ;
      b_number ++ ;
      break ;
      case 'c' : if ( c_number >= c . length ) {
        return ( 'C' ) ;
      }
      x = c [ c_number ] ;
      c_number ++ ;
      break ;
    }
  }
}

public static char abc_ans ( String str_a , String str_b , String str_c ) { char [ ] a = str_a . toCharArray ( ) ; char [ ] b = str_b . toCharArray ( ) ; char [ ] c = str_c . toCharArray ( ) ; int a_count = a . length ; int b_count = b . length ; int c_count = c . length ; int a_number = 0 ; int b_number = 0 ; int c_number = 0 ; char x = a [ a_number ] ; while ( true ) { switch ( x ) { case ' a ' : if ( a_number >= a . length ) { return ( ' A ' ) ; } x = a [ a_number ] ; a_number ++ ; break ; case ' b ' : if ( b_number >= b . length ) { return ( ' B ' ) ; } x = b [ b_number ] ; b_number ++ ; break ; case ' c ' : if ( c_number >= c . length ) { return ( ' C ' ) ; } x = c [ c_number ] ; c_number ++ ; break ; } } }
(method_declaration (modifiers) type: (integral_type) name: (identifier) parameters: (formal_parameters (formal_parameter type: (type_identifier) name: (identifier)) (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: (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: (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: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (field_access object: (identifier) field: (identifier)))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (field_access object: (identifier) field: (identifier)))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (field_access object: (identifier) field: (identifier)))) (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))) (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: (array_access array: (identifier) index: (identifier)))) (while_statement condition: (parenthesized_expression (true)) body: (block (switch_expression condition: (parenthesized_expression (identifier)) body: (switch_block (switch_block_statement_group (switch_label (character_literal)) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (field_access object: (identifier) field: (identifier)))) consequence: (block (return_statement (parenthesized_expression (character_literal))))) (expression_statement (assignment_expression left: (identifier) right: (array_access array: (identifier) index: (identifier)))) (expression_statement (update_expression (identifier))) (break_statement)) (switch_block_statement_group (switch_label (character_literal)) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (field_access object: (identifier) field: (identifier)))) consequence: (block (return_statement (parenthesized_expression (character_literal))))) (expression_statement (assignment_expression left: (identifier) right: (array_access array: (identifier) index: (identifier)))) (expression_statement (update_expression (identifier))) (break_statement)) (switch_block_statement_group (switch_label (character_literal)) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (field_access object: (identifier) field: (identifier)))) consequence: (block (return_statement (parenthesized_expression (character_literal))))) (expression_statement (assignment_expression left: (identifier) right: (array_access array: (identifier) index: (identifier)))) (expression_statement (update_expression (identifier))) (break_statement))))))))