Problem: There is a sand trail in front of Alice's home.

In daytime, people walk over it and leave a footprint on the trail for their every single step. Alice cannot distinguish the order of the footprints, but she can tell whether each footprint is made by left foot or right foot. Also she's certain that all people are walking by alternating left foot and right foot.

For example, suppose that one person walked through the trail and left some footprints. The footprints are RRLRL in order along the trail ('R' means right foot and 'L' means left foot). You might think the outcome of the footprints is strange. But in fact, some steps are resulting from walking backwards!

There are some possible order of steps that produce these footprints such as 1 → 3 → 2 → 5 → 4 or 2 → 3 → 4 → 5 → 1 (we suppose that the distance between two consecutive steps can be arbitrarily long). The number of backward steps from above two examples are 2 and 1 separately.

Alice is interested in these footprints. Whenever there is a person walking trough the trail, she takes a picture of all these footprints along the trail and erase all of them so that next person will leave a new set of footprints. We know that people walk by alternating right foot and left foot, but we don't know if the first step is made by left foot or right foot.

Alice wants to know the minimum possible number of backward steps made by a person. But it's a little hard. Please help Alice to calculate it. You also need to construct one possible history of these footprints.

Input

Only one line containing the string S (1 ≤ |S| ≤ 100 000) containing all footprints in order along the trail from entrance to exit.

It is guaranteed that there is at least one possible footprint history.

Output

You should output 2 lines.

The first line should contain a number denoting the minimum number of backward steps.

The second line should contain a permutation of integers from 1 to |S|. This permutation should denote the order of footprints that may possible be used by person walked there.

If there are several possible answers, you may output any of them.

Examples

Input

RRLRL


Output

1
2 5 1 3 4


Input

RLRLRLRLR


Output

0
1 2 3 4 5 6 7 8 9


Input

RRRRRLLLL


Output

4
4 9 3 8 2 7 1 6 5

Note

For the first sample, one possible order is 2 → 5 → 1 → 3 → 4, among them only the step 5 → 1 is backward step so the answer is 1. 

For the second example one possible order is just to follow the order of input, thus there are no backward steps. 

For the third sample, there will be 4 backward steps because every step from L to R will be a backward step.

Solution (in CPP):

Solution:
#include <bits/stdc++.h>
const int MAX_N = (int)1e5 + 123;
const double eps = 1e-6;
const int inf = (int)1e9 + 123;
using namespace std;
string second;
int nt[MAX_N];
set<int> r, l;
bool u[MAX_N];
vector<int> ans;
int cnt;
vector<vector<int> > q[4];
vector<vector<int> > all, all2;
void out(vector<vector<int> > &all) {
  for (auto i : all)
    for (auto j : i) cout << j + 1 << ' ';
  exit(0);
}
void solve() {
  if (all.empty() || all2.empty()) {
    if (!all2.empty()) all = all2;
    out(all);
  }
  if (second[all[0][0]] != second[all2.back().back()]) swap(all2, all);
  if (second[all.back().back()] != second[all2[0][0]]) {
    for (auto i : all2) all.push_back(i);
    out(all);
  }
  if (all.back().back() >= all2.back().back()) swap(all, all2);
  all.back().push_back(all2.back().back());
  all2.back().pop_back();
  for (auto i : all2) all.push_back(i);
  out(all);
}
int main() {
  cin >> second;
  for (int i = 0; i < int((second).size()); i++) {
    if (second[i] == 'R')
      r.insert(i);
    else
      l.insert(i);
  }
  for (int i = 0; i < int((second).size()); i++) {
    if (second[i] == 'L') {
      nt[i] = -1;
      if (!r.empty()) {
        nt[i] = *r.begin();
        r.erase(r.begin());
      }
      if (!l.empty() && *l.begin() == i) l.erase(l.begin());
    } else {
      nt[i] = -1;
      if (!l.empty()) {
        nt[i] = *l.begin();
        l.erase(l.begin());
      }
      if (!r.empty() && *r.begin() == i) r.erase(r.begin());
    }
  }
  for (int i = 0; i < int((second).size()); i++) {
    if (u[i]) continue;
    cnt++;
    int now = i;
    ans.clear();
    while (1) {
      u[now] = 1;
      ans.push_back(now);
      if (nt[now] == -1) break;
      now = nt[now];
    }
    if (second[i] == 'L' && second[now] == 'L') q[0].push_back(ans);
    if (second[i] == 'L' && second[now] == 'R') q[1].push_back(ans);
    if (second[i] == 'R' && second[now] == 'L') q[2].push_back(ans);
    if (second[i] == 'R' && second[now] == 'R') q[3].push_back(ans);
  }
  assert(abs(int((q[0]).size()) - int((q[3]).size())) <= 1);
  cout << cnt - 1 << endl;
  int last = 0;
  if (int((q[0]).size()) < int((q[3]).size())) {
    last = 3;
    swap(q[0], q[3]);
  }
  for (int i = 0; i < int((q[0]).size()); i++) {
    all.push_back(q[0][i]);
    if (i < int((q[3]).size())) all.push_back(q[3][i]);
  }
  if (q[1].empty() || q[2].empty()) {
    if (q[1].empty())
      all2 = q[2];
    else
      all2 = q[1];
    solve();
  }
  if (q[1].back().back() >= q[2].back().back()) {
    q[2].back().push_back(q[1].back().back());
    q[1].back().pop_back();
    swap(q[1], q[2]);
  } else {
    q[1].back().push_back(q[2].back().back());
    q[2].back().pop_back();
  }
  all2 = q[1];
  for (auto i : q[2]) all2.push_back(i);
  solve();
  return 0;
}