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

S = input()
nN = len(S)
nAns = [ 0 for i in range(nN)]
nAnsT = [ 0 for i in range(nN)]
nAnsR = [ 0 for i in range(nN)]

for i in range(nN):
    sTmp = S[i]
    
    if sTmp =='R':
      nAnsR[i] = 1
    elif sTmp =='L':
      nAnsR[i] = -1

for i in range(nN):
  nTmp = i
  nR = 0
  nFlag = 0
  for j in range(100000):
    nR = nAnsR[nTmp]
    nTmp += nR
    
    nChk = j & 1
    if nChk == 1 and nFlag != nR:
      nAns[nTmp] += 1
      nAnsT[i]= nTmp - i
      break
    nFlag = nR
      
      
print(*nAns)



Fixed submission:
import sys
import copy

S = input()
nN = len(S)
nAns = [ 0 for i in range(nN)]
nAnsT = [ 0 for i in range(nN)]
nAnsR = [ 0 for i in range(nN)]

nCnt = S.count('RL')
nRLp = [ 0 for i in range(nCnt)]

nTmpP = 0
for i in range(nCnt):
  nTmp = S.find('RL',nTmpP)
  nRLp[i] = nTmp
  nTmpP = nTmp + 1

nCntE = S.count('LR')
nLRp = [ 0 for i in range(nCntE)]
nTmpP = 0
for i in range(nCntE):
  nTmp = S.find('LR',nTmpP)
  nLRp[i] = nTmp
  nTmpP = nTmp + 1
  
# print(nRLp)
# print(nLRp)

nTmpS = 0
for i in range(nCnt):
  nTmpR = nRLp[i]
  nTmpL = nTmpR + 1
  
  if i == nCnt - 1:
    nTmpE = nN - 1
  else:
    nTmpE = nLRp[i]
    
  nSize = nTmpE-nTmpS+1
  nB1 = nSize // 2
  nB2 = nSize // 2
  nChk = nSize % 2
  if nChk == 1:
    nB1 += 1
  
  nChk = nTmpR - nTmpS
  nChk %= 2
  if nChk == 0:
    nAns[nTmpR]=nB1
    nAns[nTmpL]=nB2
  else:
    nAns[nTmpR]=nB2
    nAns[nTmpL]=nB1
  
  nTmpS = nTmpE + 1

print(*nAns)

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

S = input()
nN = len(S)
nAns = [ 0 for i in range(nN)]

for i in range(nN):
  nTmp = i
  nR = 0
  nFlag = 0
  for j in range(100000):
    sTmp = S[nTmp]
    
    if sTmp =='R':
      nR = 1
    elif sTmp =='L':
      nR = -1
    nTmp += nR
    
    nChk = j & 1
    if nChk == 1 and nFlag != nR:
      nAns[nTmp] += 1
      break
    nFlag = nR
      
      
print(*nAns)



Fixed submission:
import sys
import copy

S = input()
nN = len(S)
nAns = [ 0 for i in range(nN)]
nAnsT = [ 0 for i in range(nN)]
nAnsR = [ 0 for i in range(nN)]

nCnt = S.count('RL')
nRLp = [ 0 for i in range(nCnt)]

nTmpP = 0
for i in range(nCnt):
  nTmp = S.find('RL',nTmpP)
  nRLp[i] = nTmp
  nTmpP = nTmp + 1

nCntE = S.count('LR')
nLRp = [ 0 for i in range(nCntE)]
nTmpP = 0
for i in range(nCntE):
  nTmp = S.find('LR',nTmpP)
  nLRp[i] = nTmp
  nTmpP = nTmp + 1
  
# print(nRLp)
# print(nLRp)

nTmpS = 0
for i in range(nCnt):
  nTmpR = nRLp[i]
  nTmpL = nTmpR + 1
  
  if i == nCnt - 1:
    nTmpE = nN - 1
  else:
    nTmpE = nLRp[i]
    
  nSize = nTmpE-nTmpS+1
  nB1 = nSize // 2
  nB2 = nSize // 2
  nChk = nSize % 2
  if nChk == 1:
    nB1 += 1
  
  nChk = nTmpR - nTmpS
  nChk %= 2
  if nChk == 0:
    nAns[nTmpR]=nB1
    nAns[nTmpL]=nB2
  else:
    nAns[nTmpR]=nB2
    nAns[nTmpL]=nB1
  
  nTmpS = nTmpE + 1

print(*nAns)

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

S = input()
nN = len(S)
nAns = [ 0 for i in range(nN)]

for i in range(nN):
  nTmp = i
  nR = 0
  nFlag = 0
  for j in range(100000):
    sTmp = S[nTmp]
    
    if sTmp =='R':
      nR = 1
    elif sTmp =='L':
      nR = -1
    nTmp += nR
    
    nChk = j & 1
    if nChk == 1 and nFlag != nR:
      nAns[nTmp] += 1
      break
    nFlag = nR
      
      
print(*nAns)



Fixed submission:
import sys
import copy

S = input()
nN = len(S)
nAns = [ 0 for i in range(nN)]
nAnsT = [ 0 for i in range(nN)]
nAnsR = [ 0 for i in range(nN)]

nCnt = S.count('RL')
nRLp = [ 0 for i in range(nCnt)]

nTmpP = 0
for i in range(nCnt):
  nTmp = S.find('RL',nTmpP)
  nRLp[i] = nTmp
  nTmpP = nTmp + 1

nCntE = S.count('LR')
nLRp = [ 0 for i in range(nCntE)]
nTmpP = 0
for i in range(nCntE):
  nTmp = S.find('LR',nTmpP)
  nLRp[i] = nTmp
  nTmpP = nTmp + 1
  
# print(nRLp)
# print(nLRp)

nTmpS = 0
for i in range(nCnt):
  nTmpR = nRLp[i]
  nTmpL = nTmpR + 1
  
  if i == nCnt - 1:
    nTmpE = nN - 1
  else:
    nTmpE = nLRp[i]
    
  nSize = nTmpE-nTmpS+1
  nB1 = nSize // 2
  nB2 = nSize // 2
  nChk = nSize % 2
  if nChk == 1:
    nB1 += 1
  
  nChk = nTmpR - nTmpS
  nChk %= 2
  if nChk == 0:
    nAns[nTmpR]=nB1
    nAns[nTmpL]=nB2
  else:
    nAns[nTmpR]=nB2
    nAns[nTmpL]=nB1
  
  nTmpS = nTmpE + 1

print(*nAns)

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

S = input()
nN = len(S)
nAns = [ 1 for i in range(nN)]
nAnsC = [ 0 for i in range(nN)]

for j in range(10**2):
  nAnsT = [ 0 for i in range(nN)]
  for i in range(nN):
    sTmp = S[i]
    
    if nAns[i]==0:
      continue
    nNum = nAns[i]
    nAns[i] = 0
    if sTmp =='R':
      nTmp = i + 1
    elif sTmp =='L':
      nTmp = i - 1
    nAnsT[nTmp] += nNum
  
  nAns = copy.deepcopy(nAnsT)
  if i==1:
    nAnsC = copy.deepcopy(nAnsT)
  else:
    nTmp2 = i
    nTmp2 &= 1
    if nTmp2 == 1:
      if nAns == nAnsC:
        break
      else:
        nAnsC = copy.deepcopy(nAns)

print(*nAns)



Fixed submission:
import sys
import copy

S = input()
nN = len(S)
nAns = [ 0 for i in range(nN)]
nAnsT = [ 0 for i in range(nN)]
nAnsR = [ 0 for i in range(nN)]

nCnt = S.count('RL')
nRLp = [ 0 for i in range(nCnt)]

nTmpP = 0
for i in range(nCnt):
  nTmp = S.find('RL',nTmpP)
  nRLp[i] = nTmp
  nTmpP = nTmp + 1

nCntE = S.count('LR')
nLRp = [ 0 for i in range(nCntE)]
nTmpP = 0
for i in range(nCntE):
  nTmp = S.find('LR',nTmpP)
  nLRp[i] = nTmp
  nTmpP = nTmp + 1
  
# print(nRLp)
# print(nLRp)

nTmpS = 0
for i in range(nCnt):
  nTmpR = nRLp[i]
  nTmpL = nTmpR + 1
  
  if i == nCnt - 1:
    nTmpE = nN - 1
  else:
    nTmpE = nLRp[i]
    
  nSize = nTmpE-nTmpS+1
  nB1 = nSize // 2
  nB2 = nSize // 2
  nChk = nSize % 2
  if nChk == 1:
    nB1 += 1
  
  nChk = nTmpR - nTmpS
  nChk %= 2
  if nChk == 0:
    nAns[nTmpR]=nB1
    nAns[nTmpL]=nB2
  else:
    nAns[nTmpR]=nB2
    nAns[nTmpL]=nB1
  
  nTmpS = nTmpE + 1

print(*nAns)

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

S = input()
nN = len(S)
nAns = [ 1 for i in range(nN)]
nAnsC = [ 0 for i in range(nN)]

for j in range(10**2):
  nAnsT = [ 0 for i in range(nN)]
  for i in range(nN):
    sTmp = S[i]
    
    if nAns[i]==0:
      continue
    nNum = nAns[i]
    nAns[i] = 0
    if sTmp =='R':
      nTmp = i + 1
    elif sTmp =='L':
      nTmp = i - 1
    nAnsT[nTmp] += nNum
  
  nAns = copy.deepcopy(nAnsT)
  if i==1:
    nAnsC = copy.deepcopy(nAnsT)
  else:
    nTmp2 = i
    nTmp2 &= 1
    if nTmp2 == 1:
      if nAns == nAnsC:
        break
      else:
        nAnsC = copy.deepcopy(nAns)
      
#    print(*nAns)
#  sTmp = S[nTmp]
#  if sTmp =='R':
#    nTmp += 1
#  elif sTmp =='L':
#    nTmp -= 1
  
#  nAns[nTmp] += 1
  
print(*nAns)



Fixed submission:
import sys
import copy

S = input()
nN = len(S)
nAns = [ 0 for i in range(nN)]
nAnsT = [ 0 for i in range(nN)]
nAnsR = [ 0 for i in range(nN)]

nCnt = S.count('RL')
nRLp = [ 0 for i in range(nCnt)]

nTmpP = 0
for i in range(nCnt):
  nTmp = S.find('RL',nTmpP)
  nRLp[i] = nTmp
  nTmpP = nTmp + 1

nCntE = S.count('LR')
nLRp = [ 0 for i in range(nCntE)]
nTmpP = 0
for i in range(nCntE):
  nTmp = S.find('LR',nTmpP)
  nLRp[i] = nTmp
  nTmpP = nTmp + 1
  
# print(nRLp)
# print(nLRp)

nTmpS = 0
for i in range(nCnt):
  nTmpR = nRLp[i]
  nTmpL = nTmpR + 1
  
  if i == nCnt - 1:
    nTmpE = nN - 1
  else:
    nTmpE = nLRp[i]
    
  nSize = nTmpE-nTmpS+1
  nB1 = nSize // 2
  nB2 = nSize // 2
  nChk = nSize % 2
  if nChk == 1:
    nB1 += 1
  
  nChk = nTmpR - nTmpS
  nChk %= 2
  if nChk == 0:
    nAns[nTmpR]=nB1
    nAns[nTmpL]=nB2
  else:
    nAns[nTmpR]=nB2
    nAns[nTmpL]=nB1
  
  nTmpS = nTmpE + 1

print(*nAns)

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

S = input()
nN = len(S)
nAns = [ 1 for i in range(nN)]
nAnsC = [ 0 for i in range(nN)]

for j in range(10**100):
  nAnsT = [ 0 for i in range(nN)]
  for i in range(nN):
    sTmp = S[i]
    
    if nAns[i]==0:
      continue
    nNum = nAns[i]
    nAns[i] = 0
    if sTmp =='R':
      nTmp = i + 1
    elif sTmp =='L':
      nTmp = i - 1
    nAnsT[nTmp] += nNum
  
  nAns = copy.deepcopy(nAnsT)
  if i==1:
    nAnsC = copy.deepcopy(nAnsT)
  else:
    nTmp2 = i
    nTmp2 &= 1
    if nTmp2 == 1:
      if nAns == nAnsC:
        break
      else:
        nAnsC = copy.deepcopy(nAns)
      
#    print(*nAns)
#  sTmp = S[nTmp]
#  if sTmp =='R':
#    nTmp += 1
#  elif sTmp =='L':
#    nTmp -= 1
  
#  nAns[nTmp] += 1
  
print(*nAns)



Fixed submission:
import sys
import copy

S = input()
nN = len(S)
nAns = [ 0 for i in range(nN)]
nAnsT = [ 0 for i in range(nN)]
nAnsR = [ 0 for i in range(nN)]

nCnt = S.count('RL')
nRLp = [ 0 for i in range(nCnt)]

nTmpP = 0
for i in range(nCnt):
  nTmp = S.find('RL',nTmpP)
  nRLp[i] = nTmp
  nTmpP = nTmp + 1

nCntE = S.count('LR')
nLRp = [ 0 for i in range(nCntE)]
nTmpP = 0
for i in range(nCntE):
  nTmp = S.find('LR',nTmpP)
  nLRp[i] = nTmp
  nTmpP = nTmp + 1
  
# print(nRLp)
# print(nLRp)

nTmpS = 0
for i in range(nCnt):
  nTmpR = nRLp[i]
  nTmpL = nTmpR + 1
  
  if i == nCnt - 1:
    nTmpE = nN - 1
  else:
    nTmpE = nLRp[i]
    
  nSize = nTmpE-nTmpS+1
  nB1 = nSize // 2
  nB2 = nSize // 2
  nChk = nSize % 2
  if nChk == 1:
    nB1 += 1
  
  nChk = nTmpR - nTmpS
  nChk %= 2
  if nChk == 0:
    nAns[nTmpR]=nB1
    nAns[nTmpL]=nB2
  else:
    nAns[nTmpR]=nB2
    nAns[nTmpL]=nB1
  
  nTmpS = nTmpE + 1

print(*nAns)

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

S = input()
nN = len(S)
nAns = [ 1 for i in range(nN)]
nAnsC = [ 0 for i in range(nN)]

for j in range(10**100):
  nAnsT = [ 0 for i in range(nN)]
  for i in range(nN):
    sTmp = S[i]
    
    if nAns[i]==0:
      continue
    nNum = nAns[i]
    nAns[i] = 0
    if sTmp =='R':
      nTmp = i + 1
    elif sTmp =='L':
      nTmp = i - 1
    nAnsT[nTmp] += nNum
  
  nAns = copy.deepcopy(nAnsT)
  if i==1:
    nAnsC = copy.deepcopy(nAnsT)
  else:
    nTmp2 = i
    nTmp2 &= 1
    if nTmp == 1:
      if nAns == nAnsC:
        break
      else:
        nAnsC = copy.deepcopy(nAns)
      
    print(*nAns)
  
print(*nAns)



Fixed submission:
import sys
import copy

S = input()
nN = len(S)
nAns = [ 0 for i in range(nN)]
nAnsT = [ 0 for i in range(nN)]
nAnsR = [ 0 for i in range(nN)]

nCnt = S.count('RL')
nRLp = [ 0 for i in range(nCnt)]

nTmpP = 0
for i in range(nCnt):
  nTmp = S.find('RL',nTmpP)
  nRLp[i] = nTmp
  nTmpP = nTmp + 1

nCntE = S.count('LR')
nLRp = [ 0 for i in range(nCntE)]
nTmpP = 0
for i in range(nCntE):
  nTmp = S.find('LR',nTmpP)
  nLRp[i] = nTmp
  nTmpP = nTmp + 1
  
# print(nRLp)
# print(nLRp)

nTmpS = 0
for i in range(nCnt):
  nTmpR = nRLp[i]
  nTmpL = nTmpR + 1
  
  if i == nCnt - 1:
    nTmpE = nN - 1
  else:
    nTmpE = nLRp[i]
    
  nSize = nTmpE-nTmpS+1
  nB1 = nSize // 2
  nB2 = nSize // 2
  nChk = nSize % 2
  if nChk == 1:
    nB1 += 1
  
  nChk = nTmpR - nTmpS
  nChk %= 2
  if nChk == 0:
    nAns[nTmpR]=nB1
    nAns[nTmpL]=nB2
  else:
    nAns[nTmpR]=nB2
    nAns[nTmpL]=nB1
  
  nTmpS = nTmpE + 1

print(*nAns)