Buggy python submission (verdict: Runtime Error):
s=input()
ans=[0]*len(s)
tmp=[]
for i in range(len(s)):
  tmp.append(s[i])
  if i < len(s)-1:
    if s[i:i+2]=="LR":
      tmp="".join(tmp)
      x = len(tmp)
      k = tmp.index("RL")
      if x%2==0:
        ans[i-x+k]=x//2
        ans[i-x+k+1]=x//2
      else:
        if max(k,x-(k+2))%2==0:
          ans[i-x+k+1]=x//2
          ans[i-x+k]=x//2 + 1
        else:
          ans[i-x+k]=x//2
          ans[i-x+k+1]=x//2 +1
print(" ".join(map(str,ans)))   
      
      

Fixed submission:
import copy
S = input()
Slen = len(S)

Sc=[0]*Slen
for i in range(Slen):
    if S[i:i+2] == 'RL':
        for j in range(i,-1,-1):
            if S[j]=='R':
                Sc[(i-j)%2 + i] += 1
            else:
                break
        for j in range(i+1,Slen):
            if S[j] == 'L':
                Sc[(j-i)%2 +i] += 1
            else:
                break    

print(" ".join(map(str,Sc)))

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

Sr = S.split('L')
R_max = len(max(Sr,key=len))
Sl = S.split('R')
L_max = len(max(Sl,key=len))
Slen = len(S)
Sc = [1] * Slen
Sc_ = [0] * Slen

S_try = max(L_max,R_max)
if S_try % 2 == 1:
    S_try += 1

for _ in range(S_try):
    for i in range(Slen):
        if S[i] == 'L':
            Sc_[i - 1] += Sc[i]
        elif S[i] == 'R':
            Sc_[i + 1] += Sc[i]
    Sc = copy.deepcopy(Sc_)
    Sc_ = [0] * Slen

print(" ".join(map(str,Sc)))



Fixed submission:
import copy
S = input()
Slen = len(S)

Sc=[0]*Slen
for i in range(Slen):
    if S[i:i+2] == 'RL':
        for j in range(i,-1,-1):
            if S[j]=='R':
                Sc[(i-j)%2 + i] += 1
            else:
                break
        for j in range(i+1,Slen):
            if S[j] == 'L':
                Sc[(j-i)%2 +i] += 1
            else:
                break    

print(" ".join(map(str,Sc)))

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

Sr = S.split('L')
R_max = len(max(Sr,key=len))
Sl = S.split('R')
L_max = len(max(Sl,key=len))

Sc = [1] * len(S)
Sc_ = [0] * len(S)

S_try = max(L_max,R_max)
if S_try % 2 == 1:
    S_try += 1

for n in range(S_try):
    for i in range(len(S)):
        if S[i] == 'L':
            Sc_[i - 1] += Sc[i]
        elif S[i] == 'R':
            Sc_[i + 1] += Sc[i]
    Sc = copy.deepcopy(Sc_)
    Sc_ = [0] * len(S)

print(" ".join(map(str,Sc)))



Fixed submission:
import copy
S = input()
Slen = len(S)

Sc=[0]*Slen
for i in range(Slen):
    if S[i:i+2] == 'RL':
        for j in range(i,-1,-1):
            if S[j]=='R':
                Sc[(i-j)%2 + i] += 1
            else:
                break
        for j in range(i+1,Slen):
            if S[j] == 'L':
                Sc[(j-i)%2 +i] += 1
            else:
                break    

print(" ".join(map(str,Sc)))

Buggy python submission (verdict: Runtime Error):
RRRLLRLLRRRLLLLL

Fixed submission:
import copy
S = input()
Slen = len(S)

Sc=[0]*Slen
for i in range(Slen):
    if S[i:i+2] == 'RL':
        for j in range(i,-1,-1):
            if S[j]=='R':
                Sc[(i-j)%2 + i] += 1
            else:
                break
        for j in range(i+1,Slen):
            if S[j] == 'L':
                Sc[(j-i)%2 +i] += 1
            else:
                break    

print(" ".join(map(str,Sc)))

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

Sr = S.split('L')
R_max = len(max(Sr,key=len))
Sl = S.split('R')
L_max = len(max(Sl,key=len))

Sc = [1] * len(S)
Sc_ = [0] * len(S)

S_try = max(L_max,R_max)
if S_try % 2 == 1:
    S_try += 1

for n in range(S_try):
    for i in range(len(S)):
        if S[i] == 'L':
            Sc_[i - 1] += Sc[i]
        elif S[i] == 'R':
            Sc_[i + 1] += Sc[i]
    Sc = Sc_[:]
    Sc_ = [0] * len(S)

print(" ".join(map(str,Sc)))



Fixed submission:
import copy
S = input()
Slen = len(S)

Sc=[0]*Slen
for i in range(Slen):
    if S[i:i+2] == 'RL':
        for j in range(i,-1,-1):
            if S[j]=='R':
                Sc[(i-j)%2 + i] += 1
            else:
                break
        for j in range(i+1,Slen):
            if S[j] == 'L':
                Sc[(j-i)%2 +i] += 1
            else:
                break    

print(" ".join(map(str,Sc)))

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

Sr = S.split('L')
R_max = len(max(Sr,key=len))
Sl = S.split('R')
L_max = len(max(Sl,key=len))

Sc = [1] * len(S)
Sc_ = [0] * len(S)

S_try = max(L_max,R_max)
if S_try % 2 == 1:
    S_try += 1

for n in range(S_try):
    for i in range(len(S)):
        if S[i] == 'L':
            Sc_[i - 1] += Sc[i]
        elif S[i] == 'R':
            Sc_[i + 1] += Sc[i]
    Sc = Sc_[:]
    Sc_ = [0] * len(S)

print(" ".join(map(str,Sc)))



Fixed submission:
import copy
S = input()
Slen = len(S)

Sc=[0]*Slen
for i in range(Slen):
    if S[i:i+2] == 'RL':
        for j in range(i,-1,-1):
            if S[j]=='R':
                Sc[(i-j)%2 + i] += 1
            else:
                break
        for j in range(i+1,Slen):
            if S[j] == 'L':
                Sc[(j-i)%2 +i] += 1
            else:
                break    

print(" ".join(map(str,Sc)))