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;
template <class free>
struct Vector {
  free* a;
  int n, n1;
  inline Vector() { a = 0, n = n1 = 0; }
  inline void push_back(const free& x) {
    if (n < n1)
      a[n++] = x;
    else {
      free* a1(new free[n1 = n1 ? n1 << 1 : 1]);
      memcpy(a1, a, sizeof(free) * n);
      if (a) delete[] a;
      (a = a1)[n++] = x;
    }
  }
  inline free& operator[](const int x) { return a[x]; }
  inline free& back() { return a[n - 1]; }
};
char s[100050];
bool is[100050];
Vector<int> a[100050];
int sta[2][100050], top[2], at, a1[100050], a1t, a2[100050], a2t, ans[100050],
    anst;
int main() {
  scanf("%s", s + 1);
  int n(strlen(s + 1));
  for (int i(1); i <= n; ++i) is[i] = s[i] == 'R';
  for (int i(n), i1; i; --i) {
    if (top[is[i] ^ 1])
      a[sta[is[i]][++top[is[i]]] = sta[is[i] ^ 1][top[is[i] ^ 1]]].push_back(i),
          --top[is[i] ^ 1];
    else
      a[sta[is[i]][++top[is[i]]] = ++at].push_back(i);
  }
  for (int i(1); i <= at; ++i) reverse(a[i].a, a[i].a + a[i].n);
  memset(top, 0, sizeof(top));
  for (int i(1), j, i1; i <= at; ++i)
    if (is[*a[i].a] ^ is[a[i].back()]) {
      i1 = !is[a[i].back()];
      for (j = 0; j < a[i].n; ++j) sta[i1][++top[i1]] = a[i][j];
    } else if (is[a[i].back()])
      a2[++a2t] = i;
    else
      a1[++a1t] = i;
  for (int i(1), i1, j; i <= a1t && i <= a2t; ++i) {
    for (i1 = a1[i], j = 0; j < a[i1].n; ++j) sta[0][++top[0]] = a[i1][j];
    for (i1 = a2[i], j = 0; j < a[i1].n; ++j) sta[0][++top[0]] = a[i1][j];
  }
  bool pd(false);
  if (top[0] && top[1]) {
    bool i1(sta[0][top[0]] < sta[1][top[1]]);
    pd = !i1;
    anst = top[!i1], memcpy(ans, sta[!i1], anst + 1 << 2);
    ans[++anst] = sta[i1][top[i1]];
    for (int i(1); i < top[i1]; ++i) ans[++anst] = sta[i1][i];
  } else if (top[0])
    anst = top[0], memcpy(ans, sta[0], anst + 1 << 2);
  else if (top[1])
    anst = top[1], memcpy(ans, sta[1], anst + 1 << 2), pd = true;
  if (a1t ^ a2t) {
    int i1;
    i1 = a1t > a2t ? a1[a1t] : a2[a2t];
    if ((!pd && a1t > a2t) || (pd && a2t > a1t)) {
      for (int i(0); i < a[i1].n; ++i) ans[++anst] = a[i1][i];
    } else {
      for (int i(anst); i; --i) ans[i + a[i1].n] = ans[i];
      memcpy(ans + 1, a[i1].a, a[i1].n << 2);
      anst += a[i1].n;
    }
  }
  printf("%d\n", at - 1);
  for (int i(1); i <= anst; ++i) printf("%d ", ans[i]);
  return 0;
}