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>
#pragma comment(linker, "/STACK:66777216")
using namespace std;
int RAND() { return (rand() << 16) + rand(); }
const int N = 100000 + 5;
char s[N];
int a[N];
int e[N];
int n;
int res;
int b[N];
int top;
int C = 0;
int r[N];
int mi[2][4 * N];
int ma[2][4 * N];
int su[2][4 * N];
int mv[2][4 * N];
void fix(int v) {
  for (int u = 0; u < (int)(2); ++u) {
    su[u][v] = su[u][v + v] + su[u][v + v + 1];
    mi[u][v] = min(mi[u][v + v], su[u][v + v] + mi[u][v + v + 1]);
    ma[u][v] = max(ma[u][v + v], su[u][v + v] + ma[u][v + v + 1]);
    mv[u][v] = min(mv[u][v + v], mv[u][v + v + 1]);
  }
}
void build(int v, int tl, int tr) {
  if (tl == tr) {
    su[0][v] = e[tl];
    su[1][v] = -su[0][v];
    for (int u = 0; u < (int)(2); ++u) {
      mi[u][v] = min(0, su[u][v]);
      ma[u][v] = max(0, su[u][v]);
    }
    mv[0][v] = mv[1][v] = N;
    if (e[tl] == -1)
      mv[0][v] = tl;
    else
      mv[1][v] = tl;
    return;
  }
  int tm = (tl + tr) / 2;
  build(v + v, tl, tm);
  build(v + v + 1, tm + 1, tr);
  fix(v);
}
void update(int v, int tl, int tr, int pos, int val) {
  if (tl == tr) {
    su[0][v] = val;
    su[1][v] = -val;
    mv[0][v] = mv[1][v] = N;
    for (int u = 0; u < (int)(2); ++u) {
      mi[u][v] = min(0, su[u][v]);
      ma[u][v] = max(0, su[u][v]);
      if (val == 2 * u - 1) mv[u][v] = tl;
    }
    return;
  }
  int tm = (tl + tr) / 2;
  if (pos <= tm)
    update(v + v, tl, tm, pos, val);
  else
    update(v + v + 1, tm + 1, tr, pos, val);
  fix(v);
}
int getpos(int v, int tl, int tr, int l, int r, int u) {
  if (l <= tl && tr <= r) return mv[u][v];
  int tm = (tl + tr) / 2;
  int res = N;
  if (l <= tm) res = min(res, getpos(v + v, tl, tm, l, r, u));
  if (r > tm) res = min(res, getpos(v + v + 1, tm + 1, tr, l, r, u));
  return res;
}
void init() {
  top = 0;
  C = 0;
  build(1, 0, n - 1);
}
void checkback(int cr) {
  int ne = getpos(1, 0, n - 1, cr + 1, n - 1, a[cr] ^ 1);
  if (ne == N) return;
  int be = getpos(1, 0, n - 1, ne + 1, n - 1, a[cr]);
  if (be != N) return;
  be = getpos(1, 0, n - 1, ne + 1, n - 1, a[cr] ^ 1);
  if (be != N) return;
  int u = a[cr];
  update(1, 0, n - 1, ne, 0);
  update(1, 0, n - 1, cr, 0);
  if (su[u][1] == 0 && mi[u][1] == 0) {
    if (C + ma[u][1] < res) {
      int val2 = C + ma[u][1];
      int C2 = C;
      int top2 = top;
      update(1, 0, n - 1, cr, a[cr]);
      while (1) {
        b[top++] = cr;
        int ne = getpos(1, 0, n - 1, cr + 1, n - 1, a[cr] ^ 1);
        if (ne == N) ne = getpos(1, 0, n - 1, 0, n - 1, a[cr] ^ 1);
        if (ne == N) break;
        if (ne < cr) ++C;
        update(1, 0, n - 1, cr, 0);
        cr = ne;
      }
      assert(val2 == C);
      b[top++] = ne;
      res = C;
      for (int i = 0; i < (int)(n); ++i) r[i] = b[i];
      for (int i = top2; i < top; ++i) update(1, 0, n - 1, b[i], e[b[i]]);
      top = top2;
      C = C2;
    }
  }
  update(1, 0, n - 1, ne, e[ne]);
  update(1, 0, n - 1, cr, e[cr]);
}
void solvefor(bool ty) {
  init();
  int cr = getpos(1, 0, n - 1, 0, n - 1, ty);
  while (1) {
    checkback(cr);
    b[top++] = cr;
    int ne = getpos(1, 0, n - 1, cr + 1, n - 1, a[cr] ^ 1);
    if (ne == N) ne = getpos(1, 0, n - 1, 0, n - 1, a[cr] ^ 1);
    if (ne == N) break;
    if (ne < cr) ++C;
    update(1, 0, n - 1, cr, 0);
    cr = ne;
  }
  if (C < res) {
    res = C;
    for (int i = 0; i < (int)(n); ++i) r[i] = b[i];
  }
}
void solve() {
  scanf("%s", s);
  n = strlen(s);
  int q[2] = {0, 0};
  for (int i = 0; i < (int)(n); ++i) {
    if (s[i] == 'R') a[i] = 1;
    e[i] = a[i] * 2 - 1;
    ++q[a[i]];
  }
  res = N;
  if (q[1] >= q[0]) solvefor(1);
  if (q[0] >= q[1]) solvefor(0);
  printf("%d\n", res);
  for (int i = 0; i < (int)(n); ++i) printf("%d ", r[i] + 1);
  puts("");
}
void testgen() {
  FILE* f = fopen("input.txt", "w");
  fclose(f);
}
int main() {
  cout << fixed;
  cout.precision(16);
  cerr << fixed;
  cerr.precision(3);
  solve();
  return 0;
}