#include <bits/stdc++.h>
const int maxn = 100007, inf = 1e9;
int n;
char str[maxn];
std::vector<int> ans;
std::set<int> s1, s2;
int getid() { return *s1.begin() < *s2.begin() ? 1 : 2; }
void solve() {
  int cnt = 0, now = 2, pos = 0, next = *s1.begin();
  for (int i = 1; i <= n; ++i)
    if (now == 1) {
      if (next == inf ||
          (getid() == 2 && *s1.lower_bound(next) == inf && *s2.begin() != next))
        ++cnt, next = *s2.begin();
      ans.push_back(next);
      pos = next, s2.erase(pos), next = *s1.lower_bound(pos), now = 2;
    } else {
      if (next == inf ||
          (getid() == 1 && *s2.lower_bound(next) == inf && *s1.begin() != next))
        ++cnt, next = *s1.begin();
      ans.push_back(next);
      pos = next, s1.erase(pos), next = *s2.lower_bound(pos), now = 1;
    }
  printf("%d\n", cnt);
  for (int x : ans) printf("%d ", x);
}
int main() {
  scanf("%s", str + 1), n = strlen(str + 1), s1.insert(inf), s2.insert(inf);
  for (int i = 1; i <= n; ++i) (str[i] == 'L' ? s1 : s2).insert(i);
  if (s1.size() < s2.size() ||
      (s1.size() == s2.size() && *s1.begin() > *s2.begin()))
    swap(s1, s2);
  solve();
}
