#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5 + 10;
char str[maxn];
int fir[2], num[maxn];
vector<vector<int> > g0, g1;
void go(int cur, vector<vector<int> > &ans) {
  set<int> h[2], t;
  for (int i = 0; str[i]; i++) {
    h[str[i] == 'R'].insert(i);
    t.insert(i);
  }
  int num = fir[cur];
  while (!t.empty()) {
    vector<int> tmp;
    tmp.push_back(num);
    h[cur].erase(num), t.erase(num);
    while (1) {
      cur ^= 1;
      auto nt = h[cur].upper_bound(num);
      if (nt == h[cur].end()) {
        num = *h[cur].begin();
        break;
      }
      if (*nt == *(--t.end())) {
        if (!h[!cur].empty() && *(h[cur].begin()) < *(h[!cur].begin())) {
          num = *h[cur].begin();
          break;
        }
      }
      num = *nt;
      h[cur].erase(num);
      t.erase(num);
      tmp.push_back(num);
    }
    ans.push_back(tmp);
  }
}
int main() {
  scanf("%s", str);
  fir[0] = fir[1] = maxn;
  for (int i = 0; str[i]; i++) {
    ++num[str[i] == 'R'];
    fir[str[i] == 'R'] = min(fir[str[i] == 'R'], i);
  }
  if (num[0] > num[1])
    go(0, g0);
  else if (num[0] < num[1])
    go(1, g0);
  else {
    go(0, g0);
    go(1, g1);
    if (g0.size() > g1.size()) swap(g0, g1);
  }
  printf("%d\n", g0.size() - 1);
  for (int i = 0; i < g0.size(); i++)
    for (int j = 0; j < g0[i].size(); j++) printf("%d ", g0[i][j] + 1);
  return 0;
}
