#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 5;
int n, Inv_cnt;
char str[N];
vector<int> End[2], Inv[N], ID[4];
inline void solve() {
  if (ID[2].size() + ID[3].size()) return void();
  if (!ID[0].size() || !ID[1].size()) return void();
  int a = ID[0].back(), b = ID[1].back(), x = Inv[a].back(), y = Inv[b].back();
  (x > y) ? (Inv[b].push_back(x), Inv[a].pop_back())
          : (Inv[a].push_back(y), Inv[b].pop_back());
  ID[0].pop_back(), ID[1].pop_back(), ID[2].push_back(a), ID[3].push_back(b);
}
inline void print(int id) {
  for (auto num : Inv[id]) printf("%d ", num);
}
inline void Print(int id) {
  while (!ID[id].empty()) print(ID[id].back()), ID[id].pop_back();
}
int main() {
  scanf("%s\n", str + 1), n = strlen(str + 1);
  for (int i = 1; i <= n; ++i) {
    int now = (bool)(str[i] == 'R'), Inv_id;
    if (!End[now ^ 1].size()) End[now ^ 1].push_back(++Inv_cnt);
    Inv_id = End[now ^ 1].back();
    Inv[Inv_id].push_back(i), End[now].push_back(Inv_id),
        End[now ^ 1].pop_back();
  }
  for (int i = 1; i <= Inv_cnt; ++i)
    ID[(str[Inv[i].front()] == str[Inv[i].back()]) * 2 +
       (str[Inv[i].front()] == 'R')]
        .push_back(i);
  solve();
  printf("%d\n", Inv_cnt - 1);
  int _1 = ID[2].size(), _2 = ID[3].size();
  if (_2)
    Print(1), Print(3), Print(0), Print(2);
  else
    Print(0), Print(2), Print(1);
  return 0;
}
