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.
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.
s=input()
n=len(s)
lid,sz=[],0
lst=[[],[]]
for id,c in enumerate(s):
	c=c=='R'
	if not lst[not c]:	
		lst[not c].append(sz)
		lid.append([]);sz+=1
	lid[lst[not c][-1]].append(id)
	lst[c].append(lst[not c][-1])
	lst[not c].pop()
print(sz-1)
nlst=[[],[],[],[]]
for j in range(2):
	for id in lst[j]:
		i=j^(~len(lid[id])&1)
		nlst[(i<<1)|j].append(id)
szLL=len(nlst[0])
szRR=len(nlst[3])
ans=[]
if szLL<szRR:
	nlst[0],nlst[3]=nlst[3],nlst[0]
	nlst[1],nlst[2]=nlst[2],nlst[1]
	szLL,szRR=szRR,szLL
if szLL>szRR:
	for i in range(szRR):
		a=nlst[0][i]
		b=nlst[3][i]
		if lid[a][-1]>lid[b][-1]:
			lid[b].append(lid[a][-1])
			lid[a].pop()
		else:
			lid[a].append(lid[b][-1])
			lid[b].pop()
		nlst[1].append(a)
		nlst[2].append(b)
	for id in nlst[1]:
		ans.extend(lid[id])
	ans.extend(lid[nlst[0][-1]])
	for id in nlst[2]:
		ans.extend(lid[id])
elif szLL:
	for i in range(szRR-1):
		a=nlst[0][i]
		b=nlst[3][i]
		if lid[a][-1]>lid[b][-1]:
			lid[b].append(lid[a][-1])
			lid[a].pop()
		else:
			lid[a].append(lid[b][-1])
			lid[b].pop()
		nlst[1].append(a)
		nlst[2].append(b)
	for id in nlst[1]:
		ans.extend(lid[id])
	ans.extend(lid[nlst[0][-1]])
	for id in nlst[2]:
		ans.extend(lid[id])	
	ans.extend(lid[nlst[3][-1]])
elif not nlst[1]:	
	for id in nlst[2]:
		ans.extend(lid[id])
elif not nlst[2]:
	for id in nlst[1]:
		ans.extend(lid[id])	
else:
	a=nlst[1][-1]
	b=nlst[2][-1]
	if lid[a][-1]>lid[b][-1]:
		lid[b].append(lid[a][-1])
		lid[a].pop()
	else:
		lid[a].append(lid[b][-1])
		lid[b].pop()
	for id in nlst[1][:-1]:
		ans.extend(lid[id])
	ans.extend(lid[a])
	for id in nlst[2][:-1]:
		ans.extend(lid[id])	
	ans.extend(lid[b])
for i in ans:
	print(i+1,end=' ')