Buggy python submission (verdict: Time Limit Exceeded):
import sys

sys.setrecursionlimit(10 ** 5 + 10)


def input(): return sys.stdin.readline().strip()


def resolve():
    S = list(input())
    N = len(S)
    A = [1] * N
    for _ in range(N//2+1):
        for i in range(N - 1):
            if S[i] == 'R' and S[i + 1] == 'R':
                A[i + 2] += A[i]
                A[i] = 0
        for i in range(N - 1, 0, -1):
            if S[i] == 'L' and S[i - 1] == 'L':
                A[i - 2] += A[i]
                A[i] = 0
    print(*A)


resolve()

Fixed submission:
import sys

sys.setrecursionlimit(10 ** 5 + 10)


def input(): return sys.stdin.readline().strip()


def resolve():
    S = list(input())
    N = len(S)
    A = [1] * N
    for i in range(N - 1):
        if S[i] == 'R' and S[i + 1] == 'R':
            A[i + 2] += A[i]
            A[i] = 0
    for i in range(N - 1, 0, -1):
        if S[i] == 'L' and S[i - 1] == 'L':
            A[i - 2] += A[i]
            A[i] = 0
    print(*A)


resolve()

Buggy python submission (verdict: Time Limit Exceeded):
import sys

sys.setrecursionlimit(10 ** 5 + 10)


def input(): return sys.stdin.readline().strip()


def resolve():
    S = list(input())
    N=len(S)
    A=[1]*N
    for _ in range(N):
        for i in range(N-1):
            if S[i]=='R' and S[i+1]=='R':
                A[i+2]+=A[i]
                A[i]=0
        for i in range(N-1,0,-1):
            if S[i]=='L' and S[i-1]=='L':
                A[i-2]+=A[i]
                A[i]=0
    print(*A)




resolve()

Fixed submission:
import sys

sys.setrecursionlimit(10 ** 5 + 10)


def input(): return sys.stdin.readline().strip()


def resolve():
    S = list(input())
    N = len(S)
    A = [1] * N
    for i in range(N - 1):
        if S[i] == 'R' and S[i + 1] == 'R':
            A[i + 2] += A[i]
            A[i] = 0
    for i in range(N - 1, 0, -1):
        if S[i] == 'L' and S[i - 1] == 'L':
            A[i - 2] += A[i]
            A[i] = 0
    print(*A)


resolve()

Buggy python submission (verdict: Time Limit Exceeded):
from itertools import accumulate, permutations, combinations, combinations_with_replacement, groupby, product
# import math
# import numpy as np  # Pythonのみ！
# from operator import xor
# import re
# from scipy.sparse.csgraph import connected_components  # Pythonのみ！
# ↑cf.  https://note.nkmk.me/python-scipy-connected-components/
# from scipy.sparse import csr_matrix
# import string
import sys

sys.setrecursionlimit(10 ** 5 + 10)


def input(): return sys.stdin.readline().strip()


def resolve():
    S = list(input())
    ls = len(S)
    l = [1] * ls
    nl = [0] * ls
    if ls%2==1:
        val=ls+1
    else:
        val=ls
    for _ in range(val):
        for i in range(ls):
            if S[i] == 'R':
                nl[i + 1] += l[i]
            else:
                nl[i - 1] += l[i]
        for j in range(ls):
            l[j] = nl[j]
            nl[j] = 0
    print(*l)


resolve()

Fixed submission:
import sys

sys.setrecursionlimit(10 ** 5 + 10)


def input(): return sys.stdin.readline().strip()


def resolve():
    S = list(input())
    N = len(S)
    A = [1] * N
    for i in range(N - 1):
        if S[i] == 'R' and S[i + 1] == 'R':
            A[i + 2] += A[i]
            A[i] = 0
    for i in range(N - 1, 0, -1):
        if S[i] == 'L' and S[i - 1] == 'L':
            A[i - 2] += A[i]
            A[i] = 0
    print(*A)


resolve()

Buggy python submission (verdict: Time Limit Exceeded):
from itertools import accumulate, permutations, combinations, combinations_with_replacement, groupby, product
# import math
# import numpy as np  # Pythonのみ！
# from operator import xor
# import re
# from scipy.sparse.csgraph import connected_components  # Pythonのみ！
# ↑cf.  https://note.nkmk.me/python-scipy-connected-components/
# from scipy.sparse import csr_matrix
# import string
import sys

sys.setrecursionlimit(10 ** 5 + 10)


def input(): return sys.stdin.readline().strip()


def resolve():
    S = list(input())
    ls = len(S)
    l = [1] * ls
    nl = [0] * ls
    for _ in range(ls*2):
        for i in range(ls):
            if S[i] == 'R':
                nl[i + 1] += l[i]
            else:
                nl[i - 1] += l[i]
        for j in range(ls):
            l[j] = nl[j]
            nl[j] = 0
    print(*l)


resolve()

Fixed submission:
import sys

sys.setrecursionlimit(10 ** 5 + 10)


def input(): return sys.stdin.readline().strip()


def resolve():
    S = list(input())
    N = len(S)
    A = [1] * N
    for i in range(N - 1):
        if S[i] == 'R' and S[i + 1] == 'R':
            A[i + 2] += A[i]
            A[i] = 0
    for i in range(N - 1, 0, -1):
        if S[i] == 'L' and S[i - 1] == 'L':
            A[i - 2] += A[i]
            A[i] = 0
    print(*A)


resolve()