Buggy python submission (verdict: Time Limit Exceeded):
s = input().rstrip()

pp = prev = [0]*len(s)
cur = [1]*len(s)

cnt = 0
while cur!=prev and cur!=pp:
    cnt = not cnt
    tmp = [0]*len(s)
    for i, c in enumerate(s):
        if c == 'R':
            tmp[i+1] += cur[i]
        else:
            tmp[i-1] += cur[i]
    pp,prev,cur = prev,cur,tmp

if cnt:
    print(*prev)
else:
    print(*cur)

Fixed submission:
s = input().rstrip() + 'X'

r_cnt = l_cnt = 0
is_r = True
begin_l = None
ans = [0] * (len(s)-1)
for i in range(len(s)):
    if is_r and s[i] == 'R':
#         print(f'{i}: R')
        r_cnt += 1
    elif not is_r and s[i] == 'L':
#         print(f'{i}: L')
        l_cnt += 1
    elif s[i] == 'L':
#         print(f'{i}: R>L')
        is_r = False
        l_cnt = 1
        begin_l = i
    else:
#         print(f'{i}: L>?')
        is_r = True
#         print(l_cnt, r_cnt)
        tot = l_cnt + r_cnt
        small = tot//2
        large = tot - small
        if r_cnt%2:
            ans[begin_l-1] = large 
            ans[begin_l] = small
        else:
            ans[begin_l-1] = small
            ans[begin_l] = large
        r_cnt = 1
        l_cnt = 0

print(*ans)

Buggy python submission (verdict: Time Limit Exceeded):
from itertools import repeat
s = open(0).read().rstrip()
# from sys import stdin
# s = stdin.readline().rstrip()
state = [1]*len(s)

# from collections import defaultdict

# d = defaultdict(int)
d = set()
i = 0

def transit(l, s):
    tmp = [0]*len(s)
    for i in range(len(s)):
        if s[i] == 'R':
            tmp[i+1] += l[i]
        else:
            tmp[i-1] += l[i]
    return tmp

d.add(tuple(state))

while 1:
    prev_state, state = state, transit(state, s)
    i += 1
    tup = tuple(state)
    if tup in d:
        break
    d.add(tup)

if i%2:
    state = prev_state

print(*state)

Fixed submission:
s = input().rstrip() + 'X'

r_cnt = l_cnt = 0
is_r = True
begin_l = None
ans = [0] * (len(s)-1)
for i in range(len(s)):
    if is_r and s[i] == 'R':
#         print(f'{i}: R')
        r_cnt += 1
    elif not is_r and s[i] == 'L':
#         print(f'{i}: L')
        l_cnt += 1
    elif s[i] == 'L':
#         print(f'{i}: R>L')
        is_r = False
        l_cnt = 1
        begin_l = i
    else:
#         print(f'{i}: L>?')
        is_r = True
#         print(l_cnt, r_cnt)
        tot = l_cnt + r_cnt
        small = tot//2
        large = tot - small
        if r_cnt%2:
            ans[begin_l-1] = large 
            ans[begin_l] = small
        else:
            ans[begin_l-1] = small
            ans[begin_l] = large
        r_cnt = 1
        l_cnt = 0

print(*ans)

Buggy python submission (verdict: Time Limit Exceeded):
# s = open(0).read().rstrip()
from sys import stdin
s = stdin.readline().rstrip()

state = [1]*len(s)

# from collections import defaultdict

# d = defaultdict(int)
d = set()
i = 0

def transit(l, s):
    tmp = [0]*len(l)
    for i in range(len(l)):
        if s[i] == 'R':
            tmp[i+1] += l[i]
        else:
            tmp[i-1] += l[i]
    return tmp

d.add(tuple(state))

while 1:
    state = transit(state, s)
    i += 1
    tup = tuple(state)
    if tup in d:
        break
    d.add(tup)

if i%2:
    state = transit(state, s)

print(*state)

Fixed submission:
s = input().rstrip() + 'X'

r_cnt = l_cnt = 0
is_r = True
begin_l = None
ans = [0] * (len(s)-1)
for i in range(len(s)):
    if is_r and s[i] == 'R':
#         print(f'{i}: R')
        r_cnt += 1
    elif not is_r and s[i] == 'L':
#         print(f'{i}: L')
        l_cnt += 1
    elif s[i] == 'L':
#         print(f'{i}: R>L')
        is_r = False
        l_cnt = 1
        begin_l = i
    else:
#         print(f'{i}: L>?')
        is_r = True
#         print(l_cnt, r_cnt)
        tot = l_cnt + r_cnt
        small = tot//2
        large = tot - small
        if r_cnt%2:
            ans[begin_l-1] = large 
            ans[begin_l] = small
        else:
            ans[begin_l-1] = small
            ans[begin_l] = large
        r_cnt = 1
        l_cnt = 0

print(*ans)

Buggy python submission (verdict: Time Limit Exceeded):
s = open(0).read().rstrip()

state = [1]*len(s)

# from collections import defaultdict

# d = defaultdict(int)
d = set()
i = 0

def transit(l, s):
    tmp = [0]*len(l)
    for i in range(len(l)):
        if s[i] == 'R':
            tmp[i+1] += l[i]
        else:
            tmp[i-1] += l[i]
    return tmp

d.add(tuple(state))

while 1:
    state = transit(state, s)
    i += 1
    tup = tuple(state)
    if tup in d:
        break
    d.add(tup)

if i%2:
    state = transit(state, s)

print(*state)

Fixed submission:
s = input().rstrip() + 'X'

r_cnt = l_cnt = 0
is_r = True
begin_l = None
ans = [0] * (len(s)-1)
for i in range(len(s)):
    if is_r and s[i] == 'R':
#         print(f'{i}: R')
        r_cnt += 1
    elif not is_r and s[i] == 'L':
#         print(f'{i}: L')
        l_cnt += 1
    elif s[i] == 'L':
#         print(f'{i}: R>L')
        is_r = False
        l_cnt = 1
        begin_l = i
    else:
#         print(f'{i}: L>?')
        is_r = True
#         print(l_cnt, r_cnt)
        tot = l_cnt + r_cnt
        small = tot//2
        large = tot - small
        if r_cnt%2:
            ans[begin_l-1] = large 
            ans[begin_l] = small
        else:
            ans[begin_l-1] = small
            ans[begin_l] = large
        r_cnt = 1
        l_cnt = 0

print(*ans)