Buggy python submission (verdict: Time Limit Exceeded):
s = input()
n = len(s)
S=[0 for i in range(n)]
for i in range(n):
    if s[i]=="R":
        S[i]=1


ANS =[0 for i in range(n)]
tame =[0,0]
k=0
for i in range(n):
    if S[i] == 1:
        tame[k]+=1
        k = (k+1)%2
    elif tame[0]>0:
        ANS[i-1] += tame[0]
        ANS[i] += tame[1]
        tame=[0,0]
        k=0
tame =[0,0]
k=0
for i in range(n-1,-1,-1):
    if S[i] == 0:
        tame[k]+=1
        k = (k+1)%2
    elif tame[0]>0:
        ANS[i+1] += tame[0]
        ANS[i] += tame[1]
        tame=[0,0]
        k=0
#print(ANS)
ans=""
for i in range(n):
    ans += str(ANS[i])
    ans += " "
print(ans)
#print(n)

Fixed submission:
s = input()
n = len(s)
S=[0 for i in range(n)]
for i in range(n):
    if s[i]=="R":
        S[i]=1


ANS =[0 for i in range(n)]
tame =[0,0]
k=0
for i in range(n):
    if S[i] == 1:
        tame[k]+=1
        k = (k+1)%2
    elif tame[0]>0:
        ANS[i-1] += tame[0]
        ANS[i] += tame[1]
        tame=[0,0]
        k=0
tame =[0,0]
k=0
for i in range(n-1,-1,-1):
    if S[i] == 0:
        tame[k]+=1
        k = (k+1)%2
    elif tame[0]>0:
        ANS[i+1] += tame[0]
        ANS[i] += tame[1]
        tame=[0,0]
        k=0
#print(ANS)
ans=""
for i in range(n):
    ans += str(ANS[i])
    ans += " "
print(ans)
#print(n)

Buggy python submission (verdict: Time Limit Exceeded):
s = input()
n = len(s)
S=[0 for i in range(n)]
for i in range(n):
    if s[i]=="R":
        S[i]=1


ANS =[0 for i in range(n)]
tame =[0,0]
k=0
sw=1
for i in range(n):
    if S[i] == 1:
        sw=1
        tame[k]+=1
        k = (k+1)%2
    elif sw==1:
        ANS[i-1] += tame[0]
        ANS[i] += tame[1]
        sw=0
        tame=[0,0]
        k=0
tame =[0,0]
k=0
sw=1
for i in range(n-1,-1,-1):
    if S[i] == 0:
        sw=1
        tame[k]+=1
        k = (k+1)%2
    elif sw==1:
        ANS[i+1] += tame[0]
        ANS[i] += tame[1]
        sw=0
        tame=[0,0]
        k=0
#print(ANS)
ans=""
for i in range(n):
    ans += str(ANS[i])
    ans += " "
print(ans)

Fixed submission:
s = input()
n = len(s)
S=[0 for i in range(n)]
for i in range(n):
    if s[i]=="R":
        S[i]=1


ANS =[0 for i in range(n)]
tame =[0,0]
k=0
for i in range(n):
    if S[i] == 1:
        tame[k]+=1
        k = (k+1)%2
    elif tame[0]>0:
        ANS[i-1] += tame[0]
        ANS[i] += tame[1]
        tame=[0,0]
        k=0
tame =[0,0]
k=0
for i in range(n-1,-1,-1):
    if S[i] == 0:
        tame[k]+=1
        k = (k+1)%2
    elif tame[0]>0:
        ANS[i+1] += tame[0]
        ANS[i] += tame[1]
        tame=[0,0]
        k=0
#print(ANS)
ans=""
for i in range(n):
    ans += str(ANS[i])
    ans += " "
print(ans)
#print(n)

Buggy python submission (verdict: Time Limit Exceeded):
s = input()
n = len(s)
S=[0]*n
for i in range(n):
    if s[i]=="R":
        S[i]=1


ANS = [0] * n
tame =0
sw=1
for i in range(n):
    if S[i] == 1:
        sw=1
        tame += 1
    elif sw==1:
        t2=tame//2
        ANS[i-1] += t2+tame%2
        ANS[i] += t2
        sw=0
        tame=0
sw=1
tame=0
for i in range(n-1,-1,-1):
    if S[i] == 0:
        sw=1
        tame += 1
    elif sw==1:
        t2=tame//2
        ANS[i+1] += t2+tame%2
        ANS[i] += t2
        sw=0
        tame=0
#print(ANS)
ans=""
for i in range(n):
    ans += str(ANS[i])
    ans += " "
print(ans)

Fixed submission:
s = input()
n = len(s)
S=[0 for i in range(n)]
for i in range(n):
    if s[i]=="R":
        S[i]=1


ANS =[0 for i in range(n)]
tame =[0,0]
k=0
for i in range(n):
    if S[i] == 1:
        tame[k]+=1
        k = (k+1)%2
    elif tame[0]>0:
        ANS[i-1] += tame[0]
        ANS[i] += tame[1]
        tame=[0,0]
        k=0
tame =[0,0]
k=0
for i in range(n-1,-1,-1):
    if S[i] == 0:
        tame[k]+=1
        k = (k+1)%2
    elif tame[0]>0:
        ANS[i+1] += tame[0]
        ANS[i] += tame[1]
        tame=[0,0]
        k=0
#print(ANS)
ans=""
for i in range(n):
    ans += str(ANS[i])
    ans += " "
print(ans)
#print(n)

Buggy python submission (verdict: Time Limit Exceeded):
s = input()
n = len(s)
ANS = [0] * n
tame =0
sw=1
for i in range(n):
    if s[i] == "R":
        sw=1
        tame += 1
    elif sw==1:
        ANS[i-1] += tame//2+tame%2
        ANS[i] += tame//2
        sw=0
        tame=0
sw=1
tame=0
for i in range(n-1,-1,-1):
    if s[i] == "L":
        sw=1
        tame += 1
    elif sw==1:
        ANS[i+1] += tame//2+tame%2
        ANS[i] += tame//2
        sw=0
        tame=0
#print(ANS)
ans=""
for i in range(n):
    ans += str(ANS[i])
    ans += " "
print(ans)

Fixed submission:
s = input()
n = len(s)
S=[0 for i in range(n)]
for i in range(n):
    if s[i]=="R":
        S[i]=1


ANS =[0 for i in range(n)]
tame =[0,0]
k=0
for i in range(n):
    if S[i] == 1:
        tame[k]+=1
        k = (k+1)%2
    elif tame[0]>0:
        ANS[i-1] += tame[0]
        ANS[i] += tame[1]
        tame=[0,0]
        k=0
tame =[0,0]
k=0
for i in range(n-1,-1,-1):
    if S[i] == 0:
        tame[k]+=1
        k = (k+1)%2
    elif tame[0]>0:
        ANS[i+1] += tame[0]
        ANS[i] += tame[1]
        tame=[0,0]
        k=0
#print(ANS)
ans=""
for i in range(n):
    ans += str(ANS[i])
    ans += " "
print(ans)
#print(n)