public static void main ( String [ ] args ) {
  Scanner s = new Scanner ( System . in ) ;
  int n = s . nextInt ( ) , m = s . nextInt ( ) , k = s . nextInt ( ) ;
  String str = s . next ( ) ;
  str = s . next ( ) ;
  char [ ] array = s . next ( ) . toCharArray ( ) ;
  int i = 1 ;
  for ( char item : array ) {
    if ( item == '0' ) {
      if ( m < k ) m = Math . max ( 1 , m - 1 ) ;
      else m = Math . min ( n , m + 1 ) ;
      if ( str . equals ( "head" ) ) k -- ;
      else k ++ ;
    }
    else {
      if ( str . equals ( "head" ) ) k -- ;
      else k ++ ;
      if ( str . equals ( "head" ) ) m = n ;
      else m = 1 ;
    }
    if ( k == n ) str = "head" ;
    else if ( k == 1 ) str = "tail" ;
    if ( m == k ) {
      System . out . println ( "Controller " + i ) ;
      System . exit ( 0 ) ;
    }
    i ++ ;
  }
  System . out . println ( "Stowaway" ) ;
}

public static void main ( String [ ] args ) { Scanner s = new Scanner ( System . in ) ; int n = s . nextInt ( ) , m = s . nextInt ( ) , k = s . nextInt ( ) ; String str = s . next ( ) ; str = s . next ( ) ; char [ ] array = s . next ( ) . toCharArray ( ) ; int i = 1 ; for ( char item : array ) { if ( item == '0' ) { if ( m < k ) m = Math . max ( 1 , m - 1 ) ; else m = Math . min ( n , m + 1 ) ; if ( str . equals ( " head " ) ) k -- ; else k ++ ; } else { if ( str . equals ( " head " ) ) k -- ; else k ++ ; if ( str . equals ( " head " ) ) m = n ; else m = 1 ; } if ( k == n ) str = " head " ; else if ( k == 1 ) str = " tail " ; if ( m == k ) { System . out . println ( " Controller ▁ " + i ) ; System . exit ( 0 ) ; } i ++ ; } System . out . println ( " Stowaway " ) ; }
(method_declaration (modifiers) type: (void_type) name: (identifier) parameters: (formal_parameters (formal_parameter type: (array_type element: (type_identifier) dimensions: (dimensions)) name: (identifier))) body: (block (local_variable_declaration type: (type_identifier) declarator: (variable_declarator name: (identifier) value: (object_creation_expression type: (type_identifier) arguments: (argument_list (field_access object: (identifier) field: (identifier)))))) (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)))) (local_variable_declaration type: (type_identifier) declarator: (variable_declarator name: (identifier) value: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)))) (expression_statement (assignment_expression left: (identifier) right: (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: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)) name: (identifier) arguments: (argument_list)))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal))) (enhanced_for_statement type: (integral_type) name: (identifier) value: (identifier) body: (block (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (character_literal))) consequence: (block (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (identifier))) consequence: (expression_statement (assignment_expression left: (identifier) right: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (decimal_integer_literal) (binary_expression left: (identifier) right: (decimal_integer_literal)))))) alternative: (expression_statement (assignment_expression left: (identifier) right: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier) (binary_expression left: (identifier) right: (decimal_integer_literal))))))) (if_statement condition: (parenthesized_expression (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (string_literal)))) consequence: (expression_statement (update_expression (identifier))) alternative: (expression_statement (update_expression (identifier))))) alternative: (block (if_statement condition: (parenthesized_expression (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (string_literal)))) consequence: (expression_statement (update_expression (identifier))) alternative: (expression_statement (update_expression (identifier)))) (if_statement condition: (parenthesized_expression (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (string_literal)))) consequence: (expression_statement (assignment_expression left: (identifier) right: (identifier))) alternative: (expression_statement (assignment_expression left: (identifier) right: (decimal_integer_literal)))))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (identifier))) consequence: (expression_statement (assignment_expression left: (identifier) right: (string_literal))) alternative: (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (decimal_integer_literal))) consequence: (expression_statement (assignment_expression left: (identifier) right: (string_literal))))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (identifier))) consequence: (block (expression_statement (method_invocation object: (field_access object: (identifier) field: (identifier)) name: (identifier) arguments: (argument_list (binary_expression left: (string_literal) right: (identifier))))) (expression_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (decimal_integer_literal)))))) (expression_statement (update_expression (identifier))))) (expression_statement (method_invocation object: (field_access object: (identifier) field: (identifier)) name: (identifier) arguments: (argument_list (string_literal))))))