import math

from collections import deque

S = eval(input())

L_kyoukai = []

R_kyoukai = [0]

flag = False

for i in range(1, len(S)):

    if flag is False and S[i] == "L":

        L_kyoukai.append(i)

        R_kyoukai.append(i - 1)

        flag = True

    if flag is True and S[i] == "R":

        L_kyoukai.append(i - 1)

        R_kyoukai.append(i)

        flag = False

ans = []

L_kyoukai.append(len(S) - 1)

r_diff = [R_kyoukai[i + 1] - R_kyoukai[i] + 1 for i in range(0, len(R_kyoukai), 2)]

l_diff = [L_kyoukai[i + 1] - L_kyoukai[i] + 1 for i in range(0, len(L_kyoukai), 2)]

for r, l in zip(r_diff, l_diff):

    tmp_1 = math.ceil(r / 2)

    tmp_2 = math.ceil(l / 2)

    ans.append(tmp_1 + l - tmp_2)

    ans.append(r - tmp_1 + tmp_2)

q = deque(ans)    

answer = ""



for i in range(len(S)):

    if 1 <= i <= len(S) - 2:

        if (S[i] == "L" and S[i - 1] == "R") or (S[i] == "R" and S[ i + 1] == "L"):

            answer += str(q.popleft())

            answer += " "

        else:

            answer += "0 "

    elif i == 0:

        if S[i + 1] == "L":

            answer += str(q.popleft())

            answer += " "

        else:

            answer += "0 "

    elif i == len(S) - 1:

        if S[i - 1] == "R":

            answer += str(q.popleft())

            answer += " "

        else:

            answer += "0 "



print(answer)        
import math

from collections import deque

S = eval(input())

ans = [0 for _ in range(len(S))]

cnt = 0

for i in range(len(S) - 1):

    if S[i] == "R":

        if S[i + 1] == "R":

            cnt += 1

        else:

            cnt += 1

            ans[i] += math.ceil(cnt / 2)

            ans[i + 1] += cnt - math.ceil(cnt / 2)

            cnt = 0

ans = ans[:: -1]

S = S[:: -1]

cnt = 0

for i in range(len(S) - 1):

    if S[i] == "L":

        if S[i + 1] == "L":

            cnt += 1

        else:

            cnt += 1

            ans[i] += math.ceil(cnt / 2)

            ans[i + 1] += cnt - math.ceil(cnt / 2)

            cnt = 0

ans = ans[:: -1]

print((" ".join(map(str, ans))))
import math
from collections import deque

S = eval(input())
L_kyoukai = []
R_kyoukai = [0]
flag = False
for i in range(1, len(S)):
    if flag is False and S[i] == "L":
        L_kyoukai.append(i)
        R_kyoukai.append(i - 1)
        flag = True
    if flag is True and S[i] == "R":
        L_kyoukai.append(i - 1)
        R_kyoukai.append(i)
        flag = False
ans = []
L_kyoukai.append(len(S) - 1)
r_diff = [R_kyoukai[i + 1] - R_kyoukai[i] + 1 for i in range(0, len(R_kyoukai), 2)]
l_diff = [L_kyoukai[i + 1] - L_kyoukai[i] + 1 for i in range(0, len(L_kyoukai), 2)]
for r, l in zip(r_diff, l_diff):
    tmp_1 = math.ceil(r / 2)
    tmp_2 = math.ceil(l / 2)
    ans.append(tmp_1 + l - tmp_2)
    ans.append(r - tmp_1 + tmp_2)
q = deque(ans)
answer = ""
for i in range(len(S)):
    if 1 <= i <= len(S) - 2:
        if (S[i] == "L" and S[i - 1] == "R") or (S[i] == "R" and S[i + 1] == "L"):
            answer += str(q.popleft())
            answer += " "
        else:
            answer += "0 "
    elif i == 0:
        if S[i + 1] == "L":
            answer += str(q.popleft())
            answer += " "
        else:
            answer += "0 "
    elif i == len(S) - 1:
        if S[i - 1] == "R":
            answer += str(q.popleft())
            answer += " "
        else:
            answer += "0 "
print(answer)

import math
from collections import deque

S = eval(input())
ans = [0 for _ in range(len(S))]
cnt = 0
for i in range(len(S) - 1):
    if S[i] == "R":
        if S[i + 1] == "R":
            cnt += 1
        else:
            cnt += 1
            ans[i] += math.ceil(cnt / 2)
            ans[i + 1] += cnt - math.ceil(cnt / 2)
            cnt = 0
ans = ans[::-1]
S = S[::-1]
cnt = 0
for i in range(len(S) - 1):
    if S[i] == "L":
        if S[i + 1] == "L":
            cnt += 1
        else:
            cnt += 1
            ans[i] += math.ceil(cnt / 2)
            ans[i + 1] += cnt - math.ceil(cnt / 2)
            cnt = 0
ans = ans[::-1]
print((" ".join(map(str, ans))))

-L_kyoukai = [] -R_kyoukai = [0] -flag = False -for i in range(1, len(S)): -    if flag is False and S[i] == "L": -        L_kyoukai.append(i) -        R_kyoukai.append(i - 1) -        flag = True -    if flag is True and S[i] == "R": -        L_kyoukai.append(i - 1) -        R_kyoukai.append(i) -        flag = False -ans = [] -L_kyoukai.append(len(S) - 1) -r_diff = [R_kyoukai[i + 1] - R_kyoukai[i] + 1 for i in range(0, len(R_kyoukai), 2)] -l_diff = [L_kyoukai[i + 1] - L_kyoukai[i] + 1 for i in range(0, len(L_kyoukai), 2)] -for r, l in zip(r_diff, l_diff): -    tmp_1 = math.ceil(r / 2) -    tmp_2 = math.ceil(l / 2) -    ans.append(tmp_1 + l - tmp_2) -    ans.append(r - tmp_1 + tmp_2) -q = deque(ans) -answer = "" -for i in range(len(S)): -    if 1 <= i <= len(S) - 2: -        if (S[i] == "L" and S[i - 1] == "R") or (S[i] == "R" and S[i + 1] == "L"): -            answer += str(q.popleft()) -            answer += " " +ans = [0 for _ in range(len(S))] +cnt = 0 +for i in range(len(S) - 1): +    if S[i] == "R": +        if S[i + 1] == "R": +            cnt += 1 -            answer += "0 " -    elif i == 0: +            cnt += 1 +            ans[i] += math.ceil(cnt / 2) +            ans[i + 1] += cnt - math.ceil(cnt / 2) +            cnt = 0 +ans = ans[::-1] +S = S[::-1] +cnt = 0 +for i in range(len(S) - 1): +    if S[i] == "L": -            answer += str(q.popleft()) -            answer += " " +            cnt += 1 -            answer += "0 " -    elif i == len(S) - 1: -        if S[i - 1] == "R": -            answer += str(q.popleft()) -            answer += " " -        else: -            answer += "0 " -print(answer) +            cnt += 1 +            ans[i] += math.ceil(cnt / 2) +            ans[i + 1] += cnt - math.ceil(cnt / 2) +            cnt = 0 +ans = ans[::-1] +print((" ".join(map(str, ans))))