#include <bits/stdc++.h>
using namespace std;
inline int read() {
  int x = 0, f = 1;
  char ch = getchar();
  while (ch < '0' || ch > '9') {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') {
    x = (x << 3) + (x << 1) + (ch ^ 48);
    ch = getchar();
  }
  return x * f;
}
const int N = 1e5 + 1000, inf = 0x3f3f3f3f;
int n, cnt, nex, pos, ans[N];
char s[N];
set<int> v1, v2;
int get() { return *v1.begin() < *v2.begin() ? 1 : 2; }
int main() {
  scanf("%s", s + 1);
  n = strlen(s + 1);
  v1.insert(inf);
  v2.insert(inf);
  for (int i = 1; i <= n; i++)
    if (s[i] == 'L')
      v1.insert(i);
    else
      v2.insert(i);
  if (v1.size() < v2.size() ||
      (v1.size() == v2.size() && *v1.begin() > *v2.begin()))
    swap(v1, v2);
  pos = cnt = 0;
  nex = *v1.begin();
  for (int i = 1; i <= n; i++) {
    if (i & 1) {
      if (nex == inf ||
          (get() == 1 && *v2.lower_bound(nex) == inf && *v1.begin() != nex))
        cnt++, nex = *v1.begin();
      pos = nex;
      v1.erase(pos);
      nex = *v2.lower_bound(pos);
      ans[i] = pos;
    } else {
      if (nex == inf ||
          (get() == 2 && *v1.lower_bound(nex) == inf && *v2.begin() != nex))
        cnt++, nex = *v2.begin();
      pos = nex;
      v2.erase(pos);
      nex = *v1.lower_bound(pos);
      ans[i] = pos;
    }
  }
  cout << cnt << "\n";
  for (int i = 1; i <= n; i++) cout << ans[i] << " ";
  return 0;
}
