public static void main ( String [ ] args ) {
  Scanner sc = new Scanner ( System . in ) ;
  String [ ] s = new String [ 3 ] ;
  int [ ] flag = new int [ 3 ] ;
  for ( int i = 0 ;
  i < 3 ;
  i ++ ) {
    s [ i ] = sc . next ( ) ;
    if ( s [ i ] . equals ( "rock" ) ) flag [ i ] = 1 ;
    if ( s [ i ] . equals ( "scissors" ) ) flag [ i ] = 10 ;
    if ( s [ i ] . equals ( "paper" ) ) flag [ i ] = 100 ;
  }
  if ( flag [ 0 ] != flag [ 1 ] && flag [ 1 ] != flag [ 2 ] && flag [ 0 ] != flag [ 2 ] ) {
    System . out . println ( "?" ) ;
    System . exit ( 0 ) ;
  }
  if ( flag [ 0 ] == flag [ 1 ] && flag [ 1 ] == flag [ 2 ] && flag [ 0 ] == flag [ 2 ] ) {
    System . out . println ( "?" ) ;
    System . exit ( 0 ) ;
  }
  int ans = flag [ 0 ] + flag [ 1 ] + flag [ 2 ] ;
  if ( ans == 21 ) {
    int a = find ( 1 , flag ) ;
    print ( a ) ;
  }
  if ( ans == 210 ) {
    int a = find ( 10 , flag ) ;
    print ( a ) ;
  }
  if ( ans == 102 ) {
    int a = find ( 100 , flag ) ;
    print ( a ) ;
  }
  if ( ans == 12 || ans == 120 || ans == 201 ) System . out . println ( "?" ) ;
}

public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String [ ] s = new String [ 3 ] ; int [ ] flag = new int [ 3 ] ; for ( int i = 0 ; i < 3 ; i ++ ) { s [ i ] = sc . next ( ) ; if ( s [ i ] . equals ( " rock " ) ) flag [ i ] = 1 ; if ( s [ i ] . equals ( " scissors " ) ) flag [ i ] = 10 ; if ( s [ i ] . equals ( " paper " ) ) flag [ i ] = 100 ; } if ( flag [ 0 ] != flag [ 1 ] && flag [ 1 ] != flag [ 2 ] && flag [ 0 ] != flag [ 2 ] ) { System . out . println ( " ? " ) ; System . exit ( 0 ) ; } if ( flag [ 0 ] == flag [ 1 ] && flag [ 1 ] == flag [ 2 ] && flag [ 0 ] == flag [ 2 ] ) { System . out . println ( " ? " ) ; System . exit ( 0 ) ; } int ans = flag [ 0 ] + flag [ 1 ] + flag [ 2 ] ; if ( ans == 21 ) { int a = find ( 1 , flag ) ; print ( a ) ; } if ( ans == 210 ) { int a = find ( 10 , flag ) ; print ( a ) ; } if ( ans == 102 ) { int a = find ( 100 , flag ) ; print ( a ) ; } if ( ans == 12 || ans == 120 || ans == 201 ) System . out . println ( " ? " ) ; }
(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: (array_type element: (type_identifier) dimensions: (dimensions)) declarator: (variable_declarator name: (identifier) value: (array_creation_expression type: (type_identifier) 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: (decimal_integer_literal)) update: (update_expression (identifier)) body: (block (expression_statement (assignment_expression left: (array_access array: (identifier) index: (identifier)) right: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)))) (if_statement condition: (parenthesized_expression (method_invocation object: (array_access array: (identifier) index: (identifier)) name: (identifier) arguments: (argument_list (string_literal)))) consequence: (expression_statement (assignment_expression left: (array_access array: (identifier) index: (identifier)) right: (decimal_integer_literal)))) (if_statement condition: (parenthesized_expression (method_invocation object: (array_access array: (identifier) index: (identifier)) name: (identifier) arguments: (argument_list (string_literal)))) consequence: (expression_statement (assignment_expression left: (array_access array: (identifier) index: (identifier)) right: (decimal_integer_literal)))) (if_statement condition: (parenthesized_expression (method_invocation object: (array_access array: (identifier) index: (identifier)) name: (identifier) arguments: (argument_list (string_literal)))) consequence: (expression_statement (assignment_expression left: (array_access array: (identifier) index: (identifier)) right: (decimal_integer_literal)))))) (if_statement condition: (parenthesized_expression (binary_expression left: (binary_expression left: (binary_expression left: (array_access array: (identifier) index: (decimal_integer_literal)) right: (array_access array: (identifier) index: (decimal_integer_literal))) right: (binary_expression left: (array_access array: (identifier) index: (decimal_integer_literal)) right: (array_access array: (identifier) index: (decimal_integer_literal)))) right: (binary_expression left: (array_access array: (identifier) index: (decimal_integer_literal)) right: (array_access array: (identifier) index: (decimal_integer_literal))))) consequence: (block (expression_statement (method_invocation object: (field_access object: (identifier) field: (identifier)) name: (identifier) arguments: (argument_list (string_literal)))) (expression_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (decimal_integer_literal)))))) (if_statement condition: (parenthesized_expression (binary_expression left: (binary_expression left: (binary_expression left: (array_access array: (identifier) index: (decimal_integer_literal)) right: (array_access array: (identifier) index: (decimal_integer_literal))) right: (binary_expression left: (array_access array: (identifier) index: (decimal_integer_literal)) right: (array_access array: (identifier) index: (decimal_integer_literal)))) right: (binary_expression left: (array_access array: (identifier) index: (decimal_integer_literal)) right: (array_access array: (identifier) index: (decimal_integer_literal))))) consequence: (block (expression_statement (method_invocation object: (field_access object: (identifier) field: (identifier)) name: (identifier) arguments: (argument_list (string_literal)))) (expression_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (decimal_integer_literal)))))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (binary_expression left: (binary_expression left: (array_access array: (identifier) index: (decimal_integer_literal)) right: (array_access array: (identifier) index: (decimal_integer_literal))) right: (array_access array: (identifier) index: (decimal_integer_literal))))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (decimal_integer_literal))) consequence: (block (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (method_invocation name: (identifier) arguments: (argument_list (decimal_integer_literal) (identifier))))) (expression_statement (method_invocation name: (identifier) arguments: (argument_list (identifier)))))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (decimal_integer_literal))) consequence: (block (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (method_invocation name: (identifier) arguments: (argument_list (decimal_integer_literal) (identifier))))) (expression_statement (method_invocation name: (identifier) arguments: (argument_list (identifier)))))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (decimal_integer_literal))) consequence: (block (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (method_invocation name: (identifier) arguments: (argument_list (decimal_integer_literal) (identifier))))) (expression_statement (method_invocation name: (identifier) arguments: (argument_list (identifier)))))) (if_statement condition: (parenthesized_expression (binary_expression left: (binary_expression left: (binary_expression left: (identifier) right: (decimal_integer_literal)) right: (binary_expression left: (identifier) right: (decimal_integer_literal))) right: (binary_expression left: (identifier) right: (decimal_integer_literal)))) consequence: (expression_statement (method_invocation object: (field_access object: (identifier) field: (identifier)) name: (identifier) arguments: (argument_list (string_literal)))))))