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 JAVA):

Solution:
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.io.IOException;
import java.util.TreeSet;
import java.util.ArrayList;
import java.util.List;
import java.util.Comparator;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        TaskE solver = new TaskE();
        solver.solve(1, in, out);
        out.close();
    }

    static class TaskE {
        private List<Integer> ans;

        public void solve(int testNumber, InputReader in, PrintWriter out) {
            String S = in.next();
            int N = S.length();

            int[] next = new int[N], length = new int[N];
            char[] end = new char[N];

            Comparator<Integer> cmp = (a, b) -> length[b] == length[a] ? b - a : length[b] - length[a];
            TreeSet<Integer> ls = new TreeSet<>(cmp), rs = new TreeSet<>(cmp);
            for (int i = N - 1; i >= 0; --i) {
                if (S.charAt(i) == 'L') {
                    if (rs.isEmpty()) {
                        end[i] = 'L';
                        next[i] = -1;
                        length[i] = 1;
                    } else {
                        next[i] = rs.pollFirst();
                        end[i] = end[next[i]];
                        length[i] = length[next[i]] + 1;
                    }
                    ls.add(i);
                } else {
                    if (ls.isEmpty()) {
                        end[i] = 'R';
                        next[i] = -1;
                        length[i] = 1;
                    } else {
                        next[i] = ls.pollFirst();
                        end[i] = end[next[i]];
                        length[i] = length[next[i]] + 1;
                    }
                    rs.add(i);
                }
            }

            List<Integer> ll = new ArrayList<>(), rr = new ArrayList<>();
            List<Integer> lr = new ArrayList<>(), rl = new ArrayList<>();

            for (int p : ls) (end[p] == 'L' ? ll : lr).add(p);
            for (int p : rs) (end[p] == 'R' ? rr : rl).add(p);

            out.println(ll.size() + rr.size() + lr.size() + rl.size() - 1);

            ans = new ArrayList<>();
            if (ll.isEmpty() && rr.isEmpty()) {
                if (!lr.isEmpty() && !rl.isEmpty()) throw new RuntimeException();
                for (int p : lr) addToAnswer(p, next);
                for (int p : rl) addToAnswer(p, next);
            } else {
                if (ll.size() > rr.size()) buildSolution(lr, rl, ll, rr, next);
                else buildSolution(rl, lr, rr, ll, next);
            }

            for (int p : ans) out.print(p + " ");
            out.println();
        }

        private void buildSolution(List<Integer> lr, List<Integer> rl, List<Integer> ll, List<Integer> rr,
                                   int[] next) {
            for (int p : lr) addToAnswer(p, next);
            addToAnswer(ll.remove(ll.size() - 1), next);
            for (int p : rl) addToAnswer(p, next);

            while (true) {
                if (rr.isEmpty()) break;
                addToAnswer(rr.remove(rr.size() - 1), next);
                if (ll.isEmpty()) break;
                addToAnswer(ll.remove(ll.size() - 1), next);
            }
        }

        private void addToAnswer(int pos, int[] next) {
            while (pos != -1) {
                ans.add(pos + 1);
                pos = next[pos];
            }
        }

    }

    static class InputReader {
        private InputStream stream;
        private byte[] buf = new byte[1024];
        private int curChar;
        private int numChars;

        public InputReader(InputStream stream) {
            this.stream = stream;
        }

        public int read() {
            if (numChars == -1)
                throw new UnknownError();
            if (curChar >= numChars) {
                curChar = 0;
                try {
                    numChars = stream.read(buf);
                } catch (IOException e) {
                    throw new UnknownError();
                }
                if (numChars <= 0)
                    return -1;
            }
            return buf[curChar++];
        }

        public String next() {
            int c = read();
            while (isSpaceChar(c))
                c = read();
            StringBuffer res = new StringBuffer();
            do {
                res.appendCodePoint(c);
                c = read();
            } while (!isSpaceChar(c));

            return res.toString();
        }

        private boolean isSpaceChar(int c) {
            return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
        }

    }
}