#include <bits/stdc++.h>
using namespace std;
long long gcd(long long a, long long b) { return b == 0 ? a : gcd(b, a % b); }
const int MAXLEN = 100000;
char s[MAXLEN + 1];
int slen;
int nxt[MAXLEN];
int fst[MAXLEN];
int head[2][2], nsame[MAXLEN];
void join(int i, int j) {
  int a = s[fst[i]] == 'L' ? 0 : 1, b = s[i] == 'L' ? 1 : 0,
      c = s[fst[j]] == 'L' ? 0 : 1, d = s[j] == 'L' ? 1 : 0;
  assert(b == c);
  nxt[i] = fst[j];
  fst[j] = fst[i];
  nsame[j] = head[a][d];
  head[a][d] = j;
}
void printall() {
  for (int i = (0); i < (2); ++i)
    for (int j = (0); j < (2); ++j)
      for (int x = head[i][j]; x != -1; x = nsame[x]) {
        printf("%c%c:%d..%d:", "LR"[i], "LR"[j], fst[x], x);
        for (int y = fst[x]; y != -1; y = nxt[y]) printf(" %d", y);
        puts("");
      }
}
void run() {
  scanf("%s", s);
  slen = strlen(s);
  int ret = slen - 1;
  int atL = 0, atR = 0;
  for (int i = (0); i < (slen); ++i) {
    nxt[i] = -1;
    if (s[i] == 'L') {
      if (atL <= i) atL = i + 1;
      while (atL < slen && s[atL] != 'R') ++atL;
      if (atL < slen) nxt[i] = atL++, --ret;
    }
    if (s[i] == 'R') {
      if (atR <= i) atR = i + 1;
      while (atR < slen && s[atR] != 'L') ++atR;
      if (atR < slen) nxt[i] = atR++, --ret;
    }
  }
  for (int i = (0); i < (slen); ++i) fst[i] = i;
  for (int i = (0); i < (slen); ++i)
    if (nxt[i] != -1) fst[nxt[i]] = fst[i];
  for (int i = (0); i < (2); ++i)
    for (int j = (0); j < (2); ++j) head[i][j] = -1;
  for (int i = (0); i < (slen); ++i)
    if (nxt[i] == -1) {
      int a = s[fst[i]] == 'L' ? 0 : 1, b = s[i] == 'L' ? 1 : 0;
      nsame[i] = head[a][b];
      head[a][b] = i;
    }
  while (head[0][1] != -1 && head[1][0] != -1) {
    int a = head[0][1], b = head[1][0];
    head[0][1] = nsame[a], head[1][0] = nsame[b];
    join(a, b);
  }
  while (head[0][0] != -1 && head[1][1] != -1) {
    int a = head[0][0], b = head[1][1];
    head[0][0] = nsame[a], head[1][1] = nsame[b];
    if (fst[a] > fst[b]) swap(a, b);
    int c = fst[a];
    fst[a] = nxt[c];
    nxt[c] = fst[b];
    fst[b] = c;
    join(a, b);
  }
  while (head[0][0] != -1 && nsame[head[0][0]] != -1) {
    int a = head[0][0], b = nsame[a];
    head[0][0] = nsame[b];
    join(a, b);
  }
  while (head[1][1] != -1 && nsame[head[1][1]] != -1) {
    int a = head[1][1], b = nsame[a];
    head[1][1] = nsame[b];
    join(a, b);
  }
  if (head[0][1] != -1 && head[1][1] != -1) {
    int a = head[0][1], b = head[1][1];
    head[0][1] = nsame[a], head[1][1] = nsame[b];
    join(a, b);
  }
  if (head[0][0] != -1 && head[0][1] != -1) {
    int a = head[0][0], b = head[0][1];
    head[0][0] = nsame[a], head[0][1] = nsame[b];
    join(a, b);
  }
  if (head[1][0] != -1 && head[0][0] != -1) {
    int a = head[1][0], b = head[0][0];
    head[1][0] = nsame[a], head[0][0] = nsame[b];
    join(a, b);
  }
  if (head[1][1] != -1 && head[1][0] != -1) {
    int a = head[1][1], b = head[1][0];
    head[1][1] = nsame[a], head[1][0] = nsame[b];
    join(a, b);
  }
  int s = -1;
  for (int i = (0); i < (2); ++i)
    for (int j = (0); j < (2); ++j)
      if (head[i][j] != -1) {
        assert(s == -1);
        int a = head[i][j];
        head[i][j] = nsame[a];
        s = fst[a];
      }
  printf("%d\n", ret);
  for (int x = s; x != -1; x = nxt[x]) {
    if (x != s) printf(" ");
    printf("%d", x + 1);
  }
  puts("");
}
int main() {
  run();
  return 0;
}
