a = input()
print(len(a))
s = []
k = a[0]
count = 1
for li in range(len(a)-1):
    i = li + 1
    if k == 'R' and a[i] == "R":
        count = count + 1
    if k == 'L' and a[i] == "L":
        count = count + 1
    if k == 'R' and a[i] == "L":
        s.append(count)
        count = 1
        k = "L"
    if k == 'L' and a[i] == "R":
        s.append(count)
        count = 1
        k = "R"
s.append(count)
print(s)
d = []
for i in range(len(s)//2):
    for k in range(s[i*2]-1):
        d.append(0)
    d.append((s[i*2]+1)//2+s[i*2+1]//2)
    d.append(s[i*2]//2+(s[i*2+1]+1)//2)
    for k in range(s[i*2+1]-1):
        d.append(0)
print(*d)    

