public static void solve ( ) {
  int t = scan . nextInt ( ) ;
  String str = scan . next ( ) ;
  int s = str . indexOf ( "R" ) ;
  int e = str . indexOf ( "L" ) ;
  if ( s >= 0 && e >= 0 ) out . println ( s + 1 + " " + e ) ;
  else if ( s >= 0 ) out . println ( s + 1 + " " + ( str . lastIndexOf ( "R" ) + 2 ) ) ;
  else out . println ( str . lastIndexOf ( "L" ) + 1 + " " + e ) ;
}

public static void solve ( ) { int t = scan . nextInt ( ) ; String str = scan . next ( ) ; int s = str . indexOf ( " R " ) ; int e = str . indexOf ( " L " ) ; if ( s >= 0 && e >= 0 ) out . println ( s + 1 + " ▁ " + e ) ; else if ( s >= 0 ) out . println ( s + 1 + " ▁ " + ( str . lastIndexOf ( " R " ) + 2 ) ) ; else out . println ( str . lastIndexOf ( " L " ) + 1 + " ▁ " + e ) ; }
(method_declaration (modifiers) type: (void_type) 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: (type_identifier) 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 (string_literal))))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (string_literal))))) (if_statement condition: (parenthesized_expression (binary_expression left: (binary_expression left: (identifier) right: (decimal_integer_literal)) right: (binary_expression left: (identifier) right: (decimal_integer_literal)))) consequence: (expression_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (binary_expression left: (binary_expression left: (binary_expression left: (identifier) right: (decimal_integer_literal)) right: (string_literal)) right: (identifier))))) alternative: (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (decimal_integer_literal))) consequence: (expression_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (binary_expression left: (binary_expression left: (binary_expression left: (identifier) right: (decimal_integer_literal)) right: (string_literal)) right: (parenthesized_expression (binary_expression left: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (string_literal))) right: (decimal_integer_literal))))))) alternative: (expression_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (binary_expression left: (binary_expression left: (binary_expression left: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (string_literal))) right: (decimal_integer_literal)) right: (string_literal)) right: (identifier)))))))))