#include <bits/stdc++.h>
char s[100001];
int a[2][2], b[100001], c[100001], d[100001], e[2], i, n, u, x;
inline void solve(int u, int v) {
  for (i = a[u][v], a[u][v] = b[i], d[c[i]] = 0; i; i = d[i]) printf("%d ", i);
}
int main() {
  scanf("%s", s + 1), n = strlen(s + 1);
  for (i = 1; i <= n; i++) {
    e[s[i] = s[i] == 'R']++;
    if (u = a[0][s[i] ^ 1])
      c[u] = d[c[i] = c[d[i] = u]] = i, a[0][s[i] ^ 1] = b[u],
      b[u] = a[0][s[i]], a[0][s[i]] = u;
    else if (u = a[1][s[i] ^ 1])
      c[u] = d[c[i] = c[d[i] = u]] = i, a[1][s[i] ^ 1] = b[u],
      b[u] = a[1][s[i]], a[1][s[i]] = u;
    else
      b[i] = a[s[c[i] = i]][s[d[i] = i]], a[s[i]][s[i]] = i, x++;
  }
  printf("%d\n", x - 1);
  if (e[0] > e[1]) {
    while (a[0][1]) solve(0, 1);
    while (a[1][1]) solve(0, 0), solve(1, 1);
    for (solve(0, 0); a[1][0]; solve(1, 0))
      ;
  } else if (e[0] < e[1]) {
    while (a[1][0]) solve(1, 0);
    while (a[0][0]) solve(1, 1), solve(0, 0);
    for (solve(1, 1); a[0][1]; solve(0, 1))
      ;
  } else if (a[0][0]) {
    for (solve(0, 0); a[1][0]; solve(1, 0))
      ;
    for (solve(1, 1); a[0][0]; solve(1, 1)) solve(0, 0);
    while (a[0][1]) solve(0, 1);
  } else if (!a[0][1])
    while (a[1][0]) solve(1, 0);
  else if (!a[1][0])
    while (a[0][1]) solve(0, 1);
  else if (a[0][1] < a[1][0]) {
    for (u = a[0][1], b[a[0][1] = d[c[u]] = d[u]] = b[u], c[d[u]] = c[u],
        printf("%d ", u);
         a[1][0]; solve(1, 0))
      ;
    while (a[0][1]) solve(0, 1);
  } else if (a[0][1] > a[1][0]) {
    for (u = a[1][0], b[a[1][0] = d[c[u]] = d[u]] = b[u], c[d[u]] = c[u],
        printf("%d ", u);
         a[0][1]; solve(0, 1))
      ;
    while (a[1][0]) solve(1, 0);
  }
  return 0;
}
