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 = 100005;
char s[MAXN];
vector<int> R, L, A;
int sum[MAXN << 2][2];
void pushup(int o, int flag) {
  sum[o][flag] = sum[o << 1][flag] + sum[o << 1 | 1][flag];
}
void update(int l, int r, int o, int p, int v, int flag) {
  if (l == r) {
    sum[o][flag] += v;
    return;
  }
  int m = l + r >> 1;
  if (p <= m)
    update(l, m, o << 1, p, v, flag);
  else
    update(m + 1, r, o << 1 | 1, p, v, flag);
  pushup(o, flag);
}
int res;
void call2(int l, int r, int o, int L, int R, int flag) {
  if (L <= l && r <= R) {
    res += sum[o][flag];
    return;
  }
  int m = l + r >> 1;
  if (L <= m) call2(l, m, o << 1, L, R, flag);
  if (m < R) call2(m + 1, r, o << 1 | 1, L, R, flag);
}
int pos;
void call(int l, int r, int o, int k, int flag) {
  if (l == r) {
    pos = l;
    return;
  }
  int m = l + r >> 1;
  if (k <= sum[o << 1 | 1][flag])
    call(m + 1, r, o << 1 | 1, k, flag);
  else
    call(l, m, o << 1, k - sum[o << 1 | 1][flag], flag);
}
int pos2;
void call3(int l, int r, int o, int k, int flag) {
  if (l == r) {
    pos2 = l;
    return;
  }
  int m = l + r >> 1;
  if (k <= sum[o << 1][flag])
    call3(l, m, o << 1, k, flag);
  else
    call3(m + 1, r, o << 1 | 1, k - sum[o << 1][flag], flag);
}
int main() {
  scanf("%s", s);
  int n = strlen(s);
  for (int i = 0; i < n; i++) {
    if (s[i] == 'R')
      R.push_back(i + 1);
    else
      L.push_back(i + 1);
  }
  int sz1 = R.size();
  int sz2 = L.size();
  if (sz2 > sz1) {
    swap(R, L);
    swap(sz1, sz2);
  } else if (sz1 == sz2 && L[0] < R[0]) {
    swap(R, L);
  }
  for (int i = 0; i < sz1; i++) {
    update(1, n, 1, R[i], 1, 1);
  }
  for (int i = 0; i < sz2; i++) {
    update(1, n, 1, L[i], 1, 0);
  }
  int ans = 0;
  int id = 1;
  int p = R[0];
  while (1) {
    update(1, n, 1, p, -1, id);
    A.push_back(p);
    res = 0;
    if (p + 1 <= n) call2(1, n, 1, p + 1, n, id ^ 1);
    if (res == 0) {
      if (1 <= p - 1) call2(1, n, 1, 1, p - 1, id ^ 1);
      if (res == 0) break;
      call3(1, n, 1, 1, id ^ 1);
      p = pos2;
      id ^= 1;
      ans++;
      continue;
    }
    call(1, n, 1, res, id ^ 1);
    res = 0;
    if (pos + 1 <= n) call2(1, n, 1, pos + 1, n, id);
    if (res > 0) {
      id ^= 1;
      p = pos;
    } else {
      pos2 = 0;
      if (sum[1][id] > 0) call3(1, n, 1, 1, id);
      int x = pos2;
      pos2 = 0;
      call3(1, n, 1, 1, id ^ 1);
      int y = pos2;
      if (x > y) {
        id ^= 1;
        int hh = p;
        p = y;
        ans++;
      } else {
        id ^= 1;
        p = pos;
      }
    }
  }
  printf("%d\n", ans);
  int ss = A.size();
  for (int i = 0; i < ss; i++) printf("%d ", A[i]);
  puts("");
  return 0;
}