#include <bits/stdc++.h>
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")
using namespace std;
using ll = long long;
using db = long double;
using row = vector<int>;
using ii = pair<int, int>;
const int N = 1e6 + 5, A = 6561, LG = 19, MOD = 998244353;
const int SQ = 450;
const long double EPS = 1e-7;
string second;
set<int> st[2];
int32_t main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int n;
  cin >> second;
  n = second.size();
  vector<int> out;
  for (int i = 0; i < n; i++) st[second[i] == 'L'].insert(i);
  int cnt = -1;
  while (!st[0].empty() || !st[1].empty()) {
    cnt++;
    if (st[0].empty()) {
      out.push_back(*st[1].begin());
      st[1].erase(st[1].begin());
      continue;
    }
    if (st[1].empty()) {
      out.push_back(*st[0].begin());
      st[0].erase(st[0].begin());
      continue;
    }
    bool f = *st[0].begin() > *st[1].begin();
    if (!cnt && st[0].size() != st[1].size()) f = st[1].size() > st[0].size();
    int cur = *st[f].begin();
    vector<int> tmp;
    while (true) {
      auto it = st[f].lower_bound(cur);
      if (it == st[f].end()) break;
      cur = *it;
      tmp.push_back(cur);
      st[f].erase(cur);
      f ^= 1;
    }
    if (st[f ^ 1].size() &&
        (st[f].empty() || (*st[f ^ 1].begin() < *st[f].begin()))) {
      st[f ^ 1].insert(tmp.back());
      tmp.pop_back();
    }
    for (auto x : tmp) out.push_back(x);
  }
  cout << cnt << '\n';
  for (auto x : out) cout << x + 1 << ' ';
  return 0;
}
