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 maxn = 2e5;
struct node {
  char c;
  int h;
};
vector<vector<node> > a[10];
vector<node> b[10];
vector<node> A, ans;
int f[maxn], vis[maxn];
char s[maxn];
int i, j, k, x, y, n, cnt, K, num, len, L1, L2;
void get(int o) {
  A.push_back((node){s[o], o});
  vis[o] = 1;
  while (o != f[o]) {
    vis[f[o]] = 1;
    A.push_back((node){s[f[o]], f[o]});
    o = f[o];
  }
}
int getnum() {
  int len = A.size();
  if (A[0].c == 'L') {
    if (A[len - 1].c == 'L')
      return 0;
    else
      return 2;
  } else {
    if (A[len - 1].c == 'R')
      return 1;
    else
      return 3;
  }
}
int main() {
  scanf("%s", s + 1);
  n = strlen(s + 1);
  for (i = 1; i <= n; i++) {
    j = max(j, i);
    k = max(k, i);
    f[i] = i;
    if (s[i] == 'R') {
      while (j <= n && s[j] == 'R') j++;
      if (j <= n) {
        f[i] = j;
        j++;
        cnt++;
      }
    } else {
      while (k <= n && s[k] == 'L') k++;
      if (k <= n) {
        f[i] = k;
        k++;
        cnt++;
      }
    }
  }
  for (i = 1; i <= n; i++) {
    if (vis[i]) continue;
    A.clear();
    get(i);
    num = getnum();
    a[num].push_back(A);
  }
  for (i = 2; i <= 3; i++) {
    num = a[i].size();
    for (j = 0; j < num; j++) {
      len = a[i][j].size();
      for (k = 0; k < len; k++) b[i].push_back(a[i][j][k]);
      L1 = b[2].size();
    }
  }
  L1 = b[2].size();
  int l2 = b[2].size(), l3 = b[3].size(), bl = 0;
  if (l2) bl = 1;
  if (l2 && l3) {
    if (b[2][l2 - 1].h > b[3][l3 - 1].h) {
      b[3].push_back(b[2][l2 - 1]);
      b[2].pop_back();
    } else {
      b[2].push_back(b[3][l3 - 1]);
      b[3].pop_back();
    }
  }
  if (bl) {
    l3 = b[3].size();
    for (i = 0; i < l3; i++) b[2].push_back(b[3][i]);
  }
  int l0 = a[0].size(), l1 = a[1].size();
  while (l0 && l1) {
    len = a[0][l0 - 1].size();
    for (i = 0; i < len; i++) b[2].push_back(a[0][l0 - 1][i]);
    len = a[1][l1 - 1].size();
    for (i = 0; i < len; i++) b[2].push_back(a[1][l1 - 1][i]);
    l0--;
    l1--;
  }
  if (l0) {
    len = b[2].size();
    for (i = 0; i < len; i++) ans.push_back(b[2][i]);
    len = a[0][0].size();
    for (i = 0; i < len; i++) ans.push_back(a[0][0][i]);
    if (!bl) {
      len = b[3].size();
      for (i = 0; i < len; i++) ans.push_back(b[3][i]);
    }
  } else if (l1) {
    if (!bl) {
      len = b[3].size();
      for (i = 0; i < len; i++) ans.push_back(b[3][i]);
    }
    len = a[1][0].size();
    for (i = 0; i < len; i++) ans.push_back(a[1][0][i]);
    len = b[2].size();
    for (i = 0; i < len; i++) ans.push_back(b[2][i]);
  } else if (!bl) {
    l2 = b[2].size();
    l3 = b[3].size();
    if (l2 && l3) {
      if (b[2][l2 - 1].h > b[3][l3 - 1].h) {
        b[3].push_back(b[2][l2 - 1]);
        b[2].pop_back();
      } else {
        b[2].push_back(b[3][l3 - 1]);
        b[3].pop_back();
      }
    }
    len = b[2].size();
    for (i = 0; i < len; i++) ans.push_back(b[2][i]);
    len = b[3].size();
    for (i = 0; i < len; i++) ans.push_back(b[3][i]);
  } else {
    len = b[2].size();
    for (i = 0; i < len; i++) ans.push_back(b[2][i]);
  }
  K = n - cnt - 1;
  printf("%d\n", K);
  len = ans.size();
  for (i = 0; i < len; i++) printf("%d%c", ans[i].h, i < len - 1 ? ' ' : '\n');
  return 0;
}