Buggy python submission (verdict: Time Limit Exceeded):
S = input()
#dp_roop[position] = roop
dp_roop = {}
dp_mod2 = {}

Result = [0] * len(S)
counted = set()


def roop_from(position):
    head = []
    visited = set()
    while position not in visited:
        head.append(position)
        visited.add(position)
        #print(position, head, visited)
        if S[position] == "R":
            position += 1
        else:
            position -= 1

    roop = head[head.index(position):]
    return head, roop

def register(head, roop):
    for i, position in enumerate(head):
        if position not in counted:
            mod2 = (len(head) + i) % 2
            Result[roop[mod2]] += 1
            counted.add(position)

for i in range(0, len(S)):
    if i not in counted:
        #print(i)
        head, roop = roop_from(i)
        register(head, roop)

print(*Result, sep=" ")

Fixed submission:
from math import ceil
S = input()
Result = [0] * len(S)
S += "R"

num_R = 0
num_L = 0
past_bottom_pointer = 0

for pointer in range(len(S) - 1):
    left = S[pointer]
    right = S[pointer + 1]

    if left == "R" and right == "R":
        #down
        num_R += 1

    elif left == "R" and right == "L":
        #bottom
        num_R += 1
        #print(num_R, num_L)
        Result[pointer] += ceil(num_R / 2)
        Result[pointer + 1] += num_R // 2
        num_R = 0
        past_bottom_pointer = pointer

    elif left == "L" and right == "L":
        #up
        num_L += 1

    elif left == "L" and right == "R":
        #top
        num_L += 1
        #print(num_R, num_L)
        Result[past_bottom_pointer] += num_L // 2
        Result[past_bottom_pointer + 1] += ceil(num_L / 2)
        num_L = 0

    #print(pointer, Result)

print(*Result)

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

def roop_from(position):
    head = []
    visited = set()
    while position not in visited:
        head.append(position)
        visited.add(position)
        #print(position, head, visited)
        if S[position] == "R":
            position += 1
        else:
            position -= 1

    roop = head[head.index(position):]
    return head, roop

def after_big_move(head, roop):
    if len(head) % 2 == 0:
        return roop[0]
    else:
        return roop[1]

Result = [0] * len(S)
for i in range(0, len(S)):
    head, roop = roop_from(i)
    ans = after_big_move(head, roop)
    Result[ans] += 1

print(*Result, sep=" ")

Fixed submission:
from math import ceil
S = input()
Result = [0] * len(S)
S += "R"

num_R = 0
num_L = 0
past_bottom_pointer = 0

for pointer in range(len(S) - 1):
    left = S[pointer]
    right = S[pointer + 1]

    if left == "R" and right == "R":
        #down
        num_R += 1

    elif left == "R" and right == "L":
        #bottom
        num_R += 1
        #print(num_R, num_L)
        Result[pointer] += ceil(num_R / 2)
        Result[pointer + 1] += num_R // 2
        num_R = 0
        past_bottom_pointer = pointer

    elif left == "L" and right == "L":
        #up
        num_L += 1

    elif left == "L" and right == "R":
        #top
        num_L += 1
        #print(num_R, num_L)
        Result[past_bottom_pointer] += num_L // 2
        Result[past_bottom_pointer + 1] += ceil(num_L / 2)
        num_L = 0

    #print(pointer, Result)

print(*Result)