public class Dispatcher {
public static void main(String[] args) {
String text = "SURPRISE, MOTHERFUCKER";
int i;
for (i = text.indexOf('R'); i<=text.lastIndexOf('R'); i++) {
if(i == text.indexOf('R', i)){
System.out.print(text.indexOf('R', i) + " ");
}
}
}
}