Buggy python submission (verdict: Time Limit Exceeded):
S = input()
N = len(S)
S = list(S)
Children = [0]*N

RL = []
LR = []
for i in range(N-1):
    if S[i] == 'R' and S[i+1] == 'L':
        RL.append(i+1)
    elif S[i] == 'L' and S[i+1] == 'R':
        LR.append(i+1)
LR.append(N)

Change = sorted(RL+LR)

Child = [LR[0]]
for i in range(1,len(LR)):
    Child.append(LR[i]-LR[i-1])

dig = [0]*len(Change)
dig[0] = Change[0]
for i in range(1,len(Change)):
    dig[i] = Change[i] - Change[i-1]

Rtype = [0]*len(RL)
for i in range(len(RL)):
    if Child[i] % 2 == 0:
        Rtype[i] = 0
    else:
        if dig[2*i]%2==0:
            Rtype[i] = 1
        if dig[2*i+1]%2==0:
            Rtype[i] = -1

k=0
for i in range(N):
    if i+1 in RL: #Rの方
        if Rtype[k] == -1:
            Children[i] += Child[k]//2 + 1
        else:
            Children[i] += Child[k]//2
    if i in RL: #Lの方
        if Rtype[k] == 1:
            Children[i] += Child[k]//2 + 1
        else:
            Children[i] += Child[k]//2
        k += 1

print(*Children)

Fixed submission:
def ranlength(A):
    num = list(A)
    count = 1
    result = ''
    table = []
    for i in range(len(num)):
        try:
            if num[i] == num[i+1]:
               count = count + 1
            else:
                result += str(num[i]) + str(count)
                table.append(count)
                count = 1
        except:
            result += str(num[i]) + str(count)
            table.append(count)
    return(table)
    
S = ranlength(input())
#RRLRLなら[2,1,1,1]で出る

def gather(x,y):
    ans = [0]*(x+y)
    if (x+y)%2 == 0:
        ans[x-1] = (x+y)//2
        ans[x] = (x+y)//2
    if x%2 == 0 and y%2 != 0:
        ans[x-1] = (x+y)//2
        ans[x] = (x+y)//2 + 1
    elif x%2 != 0 and y%2 == 0:
        ans[x-1] = (x+y)//2 + 1
        ans[x] = (x+y)//2
    return(ans)

children = []
for i in range(len(S)//2):
    children += gather(S[2*i],S[2*i+1])

print(*children)

Buggy python submission (verdict: Time Limit Exceeded):
S = input()
N = len(S)
S = list(S)
Children = [0]*N
RL = []
LR = []

A = [0]*N
for i in range(N):
    if S[i] =='L':
        A[i] = 1
    elif S[i] == 'R':
        A[i] = 2

for i in range(N-1):
    if A[i] == 2 and A[i+1] == 1:
        RL.append(i+1)

for i in range(N-1):
    if A[i] == 1 and A[i+1] == 2:
        LR.append(i+1)
LR.append(N)

Child = [LR[0]]
for i in range(1,len(LR)):
    Child.append(LR[i]-LR[i-1])

Change = sorted(RL+LR)
dig = [0]*len(Change)
dig[0] = Change[0]
for i in range(1,len(Change)):
    dig[i] = Change[i] - Change[i-1]

Rtype = [0]*len(RL)
for i in range(len(RL)):
    if Child[i] % 2 == 0:
        Rtype[i] = 0
    else:
        if dig[2*i]%2==0:
            Rtype[i] = 1
        if dig[2*i+1]%2==0:
            Rtype[i] = -1

k=0
for i in range(N):
    if i+1 in RL: #Rの方
        if Rtype[k] == 0:
            Children[i] += Child[k]//2
        elif Rtype[k] == 1:
            Children[i] += Child[k]//2
        elif Rtype[k] == -1:
            Children[i] += Child[k]//2 + 1
    if i in RL: #Lの方
        if Rtype[k] == 0:
            Children[i] += Child[k]//2
        elif Rtype[k] == 1:
            Children[i] += Child[k]//2 + 1
        elif Rtype[k] == -1:
            Children[i] += Child[k]//2
        k += 1

print(*Children)


Fixed submission:
def ranlength(A):
    num = list(A)
    count = 1
    result = ''
    table = []
    for i in range(len(num)):
        try:
            if num[i] == num[i+1]:
               count = count + 1
            else:
                result += str(num[i]) + str(count)
                table.append(count)
                count = 1
        except:
            result += str(num[i]) + str(count)
            table.append(count)
    return(table)
    
S = ranlength(input())
#RRLRLなら[2,1,1,1]で出る

def gather(x,y):
    ans = [0]*(x+y)
    if (x+y)%2 == 0:
        ans[x-1] = (x+y)//2
        ans[x] = (x+y)//2
    if x%2 == 0 and y%2 != 0:
        ans[x-1] = (x+y)//2
        ans[x] = (x+y)//2 + 1
    elif x%2 != 0 and y%2 == 0:
        ans[x-1] = (x+y)//2 + 1
        ans[x] = (x+y)//2
    return(ans)

children = []
for i in range(len(S)//2):
    children += gather(S[2*i],S[2*i+1])

print(*children)