Buggy python submission (verdict: Time Limit Exceeded):
S = input()

S = [s for s in S]

out = [0] * len(S)

for i, n in enumerate(S):
    if n == 'R':
        found = False
        cnt = 1

        while not found:
            if S[i + cnt] == 'L':
                found = True
            else:
                cnt += 1

        if cnt % 2 == 0:
            out[i + cnt] += 1
        else:
            out[i + cnt - 1] += 1

    else:
        found = False
        cnt = 1

        while not found:
            if S[i - cnt] == 'R':
                found = True
            else:
                cnt += 1

        if cnt % 2 == 0:
            out[i - cnt] += 1
        else:
            out[i - cnt + 1] += 1


out1 = [str(n) for n in out]

print(' '.join(out1))

Fixed submission:
S = input()
S = [s for s in S]

out = [0] * len(S)

if S[0] == 'R':
    top_R = True
    top_L = False
else:
    top_R = False
    top_L = True

for i, n in enumerate(S):
    if n == 'R':
        if top_R:
            found = False
            cnt = 1
            while not found:
                if S[i + cnt] == 'L':
                    found = True
                else:
                    cnt += 1
            top_R = False
        else:
            cnt -= 1

        if cnt % 2 == 0:
            out[i + cnt] += 1
        else:
            out[i + cnt - 1] += 1

        if cnt != 1:
            top_R = False
        else:
            top_L = True
    else:
        if top_L:
            found = False
            cnt = 1
            while not found:
                if S[i - cnt] == 'R':
                    found = True
                else:
                    cnt += 1
            top_L = False
        else:
            cnt += 1

        if cnt % 2 == 0:
            out[i - cnt] += 1
        else:
            out[i - cnt + 1] += 1

        if cnt != 1:
            top_L = False
        else:
            top_R = True

out1 = [str(n) for n in out]
print(' '.join(out1))

Buggy python submission (verdict: Time Limit Exceeded):
S = input()

S = [s for s in S]

out = [0] * len(S)
# 今R, 右に何ステップでL


for i, n in enumerate(S):
    if n == 'R':
        found = False
        cnt = 1

        while not found:
            if S[i + cnt] == 'L':
                found = True
            else:
                cnt += 1

        if cnt % 2 == 0:
            out[i + cnt] += 1
        else:
            out[i + cnt - 1] += 1

    else:
        found = False
        cnt = 1

        while not found:
            if S[i - cnt] == 'R':
                found = True
            else:
                cnt += 1

        if cnt % 2 == 0:
            out[i - cnt] += 1
        else:
            out[i - cnt + 1] += 1


out1 = [str(n) for n in out]

print(' '.join(out1))

Fixed submission:
S = input()
S = [s for s in S]

out = [0] * len(S)

if S[0] == 'R':
    top_R = True
    top_L = False
else:
    top_R = False
    top_L = True

for i, n in enumerate(S):
    if n == 'R':
        if top_R:
            found = False
            cnt = 1
            while not found:
                if S[i + cnt] == 'L':
                    found = True
                else:
                    cnt += 1
            top_R = False
        else:
            cnt -= 1

        if cnt % 2 == 0:
            out[i + cnt] += 1
        else:
            out[i + cnt - 1] += 1

        if cnt != 1:
            top_R = False
        else:
            top_L = True
    else:
        if top_L:
            found = False
            cnt = 1
            while not found:
                if S[i - cnt] == 'R':
                    found = True
                else:
                    cnt += 1
            top_L = False
        else:
            cnt += 1

        if cnt % 2 == 0:
            out[i - cnt] += 1
        else:
            out[i - cnt + 1] += 1

        if cnt != 1:
            top_L = False
        else:
            top_R = True

out1 = [str(n) for n in out]
print(' '.join(out1))