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>
using namespace std;
const int N = 1e5 + 100;
int n, tot;
char str[N];
vector<int> pot[2][2], vec[N], ans;
int main() {
  scanf("%s", str + 1), n = strlen(str + 1);
  for (int i = 1; i <= n; ++i) {
    if (str[i] == 'L') {
      if (pot[0][1].size()) {
        pot[0][0].push_back(pot[0][1].back());
        vec[pot[0][1].back()].push_back(i);
        pot[0][1].pop_back();
      } else if (pot[1][1].size()) {
        pot[1][0].push_back(pot[1][1].back());
        vec[pot[1][1].back()].push_back(i);
        pot[1][1].pop_back();
      } else
        vec[++tot].push_back(i), pot[0][0].push_back(tot);
    }
    if (str[i] == 'R') {
      if (pot[0][0].size()) {
        pot[0][1].push_back(pot[0][0].back());
        vec[pot[0][0].back()].push_back(i);
        pot[0][0].pop_back();
      } else if (pot[1][0].size()) {
        pot[1][1].push_back(pot[1][0].back());
        vec[pot[1][0].back()].push_back(i);
        pot[1][0].pop_back();
      } else
        vec[++tot].push_back(i), pot[1][1].push_back(tot);
    }
  }
  printf("%d\n", tot - 1);
  int LR = -1, RL = -1;
  if (pot[0][1].size()) {
    for (int i = 1; i < pot[0][1].size(); ++i)
      for (int x : vec[pot[0][1][i]]) vec[pot[0][1][0]].push_back(x);
    LR = pot[0][1][0];
  }
  if (pot[1][0].size()) {
    for (int i = 1; i < pot[1][0].size(); ++i)
      for (int x : vec[pot[1][0][i]]) vec[pot[1][0][0]].push_back(x);
    RL = pot[1][0][0];
  }
  if (pot[0][0].size() && ~RL)
    for (int x : vec[RL]) vec[pot[0][0].back()].push_back(x);
  if (pot[1][1].size() && ~LR)
    for (int x : vec[LR]) vec[pot[1][1].back()].push_back(x);
  if (pot[1][1].size() == pot[0][0].size()) {
    if (!pot[1][1].size()) {
      if (!(~LR))
        for (int x : vec[RL]) ans.push_back(x);
      if (!(~RL))
        for (int x : vec[LR]) ans.push_back(x);
      if (~LR && ~RL) {
        if (vec[LR].back() > vec[RL].back())
          vec[RL].push_back(vec[LR].back()), vec[LR].pop_back();
        else
          vec[LR].push_back(vec[RL].back()), vec[RL].pop_back();
        for (int x : vec[LR]) ans.push_back(x);
        for (int x : vec[RL]) ans.push_back(x);
      }
    } else {
      for (int i = 0; i < pot[1][1].size(); ++i) {
        for (auto x : vec[pot[1][1][i]]) ans.push_back(x);
        for (auto x : vec[pot[0][0][i]]) ans.push_back(x);
      }
    }
  }
  if (pot[1][1].size() > pot[0][0].size()) {
    if (!pot[0][0].size() && ~RL) {
      if (vec[pot[1][1].back()].back() > vec[RL].back())
        vec[RL].push_back(vec[pot[1][1].back()].back()),
            vec[pot[1][1].back()].pop_back();
      else
        vec[pot[1][1].back()].push_back(vec[RL].back()), vec[RL].pop_back();
      for (int x : vec[RL]) vec[pot[1][1].back()].push_back(x);
    }
    for (int i = 0; i < pot[0][0].size(); ++i) {
      for (int x : vec[pot[1][1][i]]) ans.push_back(x);
      for (int x : vec[pot[0][0][i]]) ans.push_back(x);
    }
    for (int x : vec[pot[1][1].back()]) ans.push_back(x);
  }
  if (pot[1][1].size() < pot[0][0].size()) {
    if (!pot[1][1].size() && ~LR) {
      if (vec[pot[0][0].back()].back() > vec[LR].back())
        vec[LR].push_back(vec[pot[0][0].back()].back()),
            vec[pot[0][0].back()].pop_back();
      else
        vec[pot[0][0].back()].push_back(vec[RL].back()), vec[RL].pop_back();
      for (int x : vec[LR]) vec[pot[0][0].back()].push_back(x);
    }
    for (int i = 0; i < pot[1][1].size(); ++i) {
      for (int x : vec[pot[0][0][i]]) ans.push_back(x);
      for (int x : vec[pot[1][1][i]]) ans.push_back(x);
    }
    for (int x : vec[pot[0][0].back()]) ans.push_back(x);
  }
  for (int x : ans) printf("%d ", x);
  return 0;
}