static String solve ( ) {
  int N = sc . nextInt ( ) ;
  int R = sc . nextInt ( ) ;
  int P = sc . nextInt ( ) ;
  int S = sc . nextInt ( ) ;
  String ret = null ;
  for ( int i = 0 ;
  i < 3 ;
  ++ i ) {
    int [ ] c = new int [ 3 ] ;
    for ( char ch : dp [ i ] [ N ] . toCharArray ( ) ) {
      if ( ch == 'P' ) c [ 0 ] ++ ;
      if ( ch == 'R' ) c [ 1 ] ++ ;
      if ( ch == 'S' ) c [ 2 ] ++ ;
    }
    if ( c [ 0 ] == P && c [ 1 ] == R && c [ 2 ] == S ) {
      ret = dp [ i ] [ N ] ;
    }
  }
  return ret == null ? "IMPOSSIBLE" : ret ;
}

static String solve ( ) { int N = sc . nextInt ( ) ; int R = sc . nextInt ( ) ; int P = sc . nextInt ( ) ; int S = sc . nextInt ( ) ; String ret = null ; for ( int i = 0 ; i < 3 ; ++ i ) { int [ ] c = new int [ 3 ] ; for ( char ch : dp [ i ] [ N ] . toCharArray ( ) ) { if ( ch == ' P ' ) c [ 0 ] ++ ; if ( ch == ' R ' ) c [ 1 ] ++ ; if ( ch == ' S ' ) c [ 2 ] ++ ; } if ( c [ 0 ] == P && c [ 1 ] == R && c [ 2 ] == S ) { ret = dp [ i ] [ N ] ; } } return ret == null ? " IMPOSSIBLE " : ret ; }
(method_declaration (modifiers) type: (type_identifier) name: (identifier) parameters: (formal_parameters) body: (block (local_variable_declaration type: (integral_type) 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: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)))) (local_variable_declaration type: (integral_type) 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: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)))) (local_variable_declaration type: (type_identifier) declarator: (variable_declarator name: (identifier) value: (null_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 (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))))) (enhanced_for_statement type: (integral_type) name: (identifier) value: (method_invocation object: (array_access array: (array_access array: (identifier) index: (identifier)) index: (identifier)) name: (identifier) arguments: (argument_list)) body: (block (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (character_literal))) consequence: (expression_statement (update_expression (array_access array: (identifier) index: (decimal_integer_literal))))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (character_literal))) consequence: (expression_statement (update_expression (array_access array: (identifier) index: (decimal_integer_literal))))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (character_literal))) consequence: (expression_statement (update_expression (array_access array: (identifier) index: (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: (identifier)) right: (binary_expression left: (array_access array: (identifier) index: (decimal_integer_literal)) right: (identifier))) right: (binary_expression left: (array_access array: (identifier) index: (decimal_integer_literal)) right: (identifier)))) consequence: (block (expression_statement (assignment_expression left: (identifier) right: (array_access array: (array_access array: (identifier) index: (identifier)) index: (identifier)))))))) (return_statement (ternary_expression condition: (binary_expression left: (identifier) right: (null_literal)) consequence: (string_literal) alternative: (identifier)))))