Buggy python submission (verdict: Time Limit Exceeded):
S=list(map(str,input()))
N=len(S)
M=(N//10+1)*10
Q=[0]*N
for i in range(N):
  p=i
  for j in range(M):
    if S[p]=="R":
      p=p+1
    else:
      p=p-1
  Q[p]=Q[p]+1
print(*Q)

Fixed submission:
S=list(map(str,input()))
N=len(S)
Q=[0]*N
R=[]
R1=[0]*N
L1=[0]*N
L=[]
V=[0]*N
for i in range(0,N):
  if S[i]=="R" and S[i+1]=="L":
    R.append(i)
  elif S[i]=="L" and S[i-1]=="R":
    L.append(i)
  else: V[i]=1

for i in R+L:
  Q[i]=1

x=0
for r in R:
  while x!=r:
    R1[x]=r
    x=x+1
x=N-1
for l in reversed(L):
  while x!=l:
    L1[x]=l
    x=x-1

for i in range(N):
  if V[i]==1:
    if S[i]=="R":
      if (R1[i]-i)%2==0:
        Q[R1[i]]=Q[R1[i]]+1
      else:
        Q[R1[i]+1]=Q[R1[i]+1]+1
    else:
      if (i-L1[i])%2==0:
        Q[L1[i]]=Q[L1[i]]+1
      else:
        Q[L1[i]-1]=Q[L1[i]-1]+1

print(*Q)

Buggy python submission (verdict: Time Limit Exceeded):
S=list(map(str,input()))
N=len(S)
M=(N//10+1)*10
Q=[0]*N
for i in range(N):
  p=i
  for j in range(M):
    if S[p]=="R":
      p=p+1
      if S[p]=="L" and j%2!=0:
        break
    else:
      p=p-1
      if S[p]=="R" and j%2!=0:
        break
  Q[p]=Q[p]+1
print(*Q)

Fixed submission:
S=list(map(str,input()))
N=len(S)
Q=[0]*N
R=[]
R1=[0]*N
L1=[0]*N
L=[]
V=[0]*N
for i in range(0,N):
  if S[i]=="R" and S[i+1]=="L":
    R.append(i)
  elif S[i]=="L" and S[i-1]=="R":
    L.append(i)
  else: V[i]=1

for i in R+L:
  Q[i]=1

x=0
for r in R:
  while x!=r:
    R1[x]=r
    x=x+1
x=N-1
for l in reversed(L):
  while x!=l:
    L1[x]=l
    x=x-1

for i in range(N):
  if V[i]==1:
    if S[i]=="R":
      if (R1[i]-i)%2==0:
        Q[R1[i]]=Q[R1[i]]+1
      else:
        Q[R1[i]+1]=Q[R1[i]+1]+1
    else:
      if (i-L1[i])%2==0:
        Q[L1[i]]=Q[L1[i]]+1
      else:
        Q[L1[i]-1]=Q[L1[i]-1]+1

print(*Q)

Buggy python submission (verdict: Time Limit Exceeded):
S=list(map(str,input()))
N=len(S)
M=(N//10+1)*10
Q=[0]*N
for i in range(N):
  p=i
  for j in range(M):
    if S[p]=="R":
      p=p+1
      if S[p]=="L" and j%2!=0:
        break
    else:
      p=p-1
      if S[p]=="R" and j%2!=0:
        break
  Q[p]=Q[p]+1
print(*Q)

Fixed submission:
S=list(map(str,input()))
N=len(S)
Q=[0]*N
R=[]
R1=[0]*N
L1=[0]*N
L=[]
V=[0]*N
for i in range(0,N):
  if S[i]=="R" and S[i+1]=="L":
    R.append(i)
  elif S[i]=="L" and S[i-1]=="R":
    L.append(i)
  else: V[i]=1

for i in R+L:
  Q[i]=1

x=0
for r in R:
  while x!=r:
    R1[x]=r
    x=x+1
x=N-1
for l in reversed(L):
  while x!=l:
    L1[x]=l
    x=x-1

for i in range(N):
  if V[i]==1:
    if S[i]=="R":
      if (R1[i]-i)%2==0:
        Q[R1[i]]=Q[R1[i]]+1
      else:
        Q[R1[i]+1]=Q[R1[i]+1]+1
    else:
      if (i-L1[i])%2==0:
        Q[L1[i]]=Q[L1[i]]+1
      else:
        Q[L1[i]-1]=Q[L1[i]-1]+1

print(*Q)

Buggy python submission (verdict: Time Limit Exceeded):
S=list(map(str,input()))
N=len(S)
M=(N//10+1)*10
Q=[0]*N
for i in range(N):
  p=i
  for j in range(M):
    if S[p]=="R":
      p=p+1
    else:
      p=p-1
  Q[p]=Q[p]+1
print(*Q)

Fixed submission:
S=list(map(str,input()))
N=len(S)
Q=[0]*N
R=[]
R1=[0]*N
L1=[0]*N
L=[]
V=[0]*N
for i in range(0,N):
  if S[i]=="R" and S[i+1]=="L":
    R.append(i)
  elif S[i]=="L" and S[i-1]=="R":
    L.append(i)
  else: V[i]=1

for i in R+L:
  Q[i]=1

x=0
for r in R:
  while x!=r:
    R1[x]=r
    x=x+1
x=N-1
for l in reversed(L):
  while x!=l:
    L1[x]=l
    x=x-1

for i in range(N):
  if V[i]==1:
    if S[i]=="R":
      if (R1[i]-i)%2==0:
        Q[R1[i]]=Q[R1[i]]+1
      else:
        Q[R1[i]+1]=Q[R1[i]+1]+1
    else:
      if (i-L1[i])%2==0:
        Q[L1[i]]=Q[L1[i]]+1
      else:
        Q[L1[i]-1]=Q[L1[i]-1]+1

print(*Q)

Buggy python submission (verdict: Time Limit Exceeded):
S=list(map(str,input()))
N=len(S)
Q=[0]*N
for i in range(N):
  p=i
  for j in range(1000):
    if S[p]=="R":
      p=p+1
    else:
      p=p-1
  Q[p]=Q[p]+1
print(*Q)

Fixed submission:
S=list(map(str,input()))
N=len(S)
Q=[0]*N
R=[]
R1=[0]*N
L1=[0]*N
L=[]
V=[0]*N
for i in range(0,N):
  if S[i]=="R" and S[i+1]=="L":
    R.append(i)
  elif S[i]=="L" and S[i-1]=="R":
    L.append(i)
  else: V[i]=1

for i in R+L:
  Q[i]=1

x=0
for r in R:
  while x!=r:
    R1[x]=r
    x=x+1
x=N-1
for l in reversed(L):
  while x!=l:
    L1[x]=l
    x=x-1

for i in range(N):
  if V[i]==1:
    if S[i]=="R":
      if (R1[i]-i)%2==0:
        Q[R1[i]]=Q[R1[i]]+1
      else:
        Q[R1[i]+1]=Q[R1[i]+1]+1
    else:
      if (i-L1[i])%2==0:
        Q[L1[i]]=Q[L1[i]]+1
      else:
        Q[L1[i]-1]=Q[L1[i]-1]+1

print(*Q)

Buggy python submission (verdict: Time Limit Exceeded):
S=list(map(str,input()))
ZERO=[]
T=[]
U=[]
CK=[]
odd=0
for i in range(len(S)):
  T.append(1)
for i in range(1,len(S)):
  if S[i-1]=="R" and S[i]=="R":
    ZERO.append(i-1)
  if S[i]=="L" and S[i-1]=="L":
    ZERO.append(i)
for i in range(len(ZERO)):
  CK.append(T[ZERO[i]])
U=T[:]
while sum(CK)!=0:
  for i in range(1,len(S)):
    if T[i-1]>0 and S[i-1]=="R":
      U[i]=U[i]+T[i-1]
      U[i-1]=U[i-1]-T[i-1]
    if T[i]>0 and S[i]=="L":
      U[i-1]=U[i-1]+T[i]
      U[i]=U[i]-T[i]
  odd=odd+1
  for i in range(len(ZERO)):
    CK[i]=U[ZERO[i]]
  T=U[:]
if odd%2==0:
  print(" ".join(map(str,T)))
else:
  for i in range(1,len(S)):
    if T[i-1]>0 and S[i-1]=="R":
      U[i]=U[i]+T[i-1]
      U[i-1]=U[i-1]-T[i-1]
    if T[i]>0 and S[i]=="L":
      U[i-1]=U[i-1]+T[i]
      U[i]=U[i]-T[i]
  print(" ".join(map(str,U)))

Fixed submission:
S=list(map(str,input()))
N=len(S)
Q=[0]*N
R=[]
R1=[0]*N
L1=[0]*N
L=[]
V=[0]*N
for i in range(0,N):
  if S[i]=="R" and S[i+1]=="L":
    R.append(i)
  elif S[i]=="L" and S[i-1]=="R":
    L.append(i)
  else: V[i]=1

for i in R+L:
  Q[i]=1

x=0
for r in R:
  while x!=r:
    R1[x]=r
    x=x+1
x=N-1
for l in reversed(L):
  while x!=l:
    L1[x]=l
    x=x-1

for i in range(N):
  if V[i]==1:
    if S[i]=="R":
      if (R1[i]-i)%2==0:
        Q[R1[i]]=Q[R1[i]]+1
      else:
        Q[R1[i]+1]=Q[R1[i]+1]+1
    else:
      if (i-L1[i])%2==0:
        Q[L1[i]]=Q[L1[i]]+1
      else:
        Q[L1[i]-1]=Q[L1[i]-1]+1

print(*Q)

Buggy python submission (verdict: Time Limit Exceeded):
S=list(map(str,input()))
ZERO=[]
T=[]
U=[]
CK=[]
odd=0
for i in range(len(S)):
  T.append(1)
for i in range(1,len(S)):
  if S[i-1]=="R" and S[i]=="R":
    ZERO.append(i-1)
  if S[i]=="L" and S[i-1]=="L":
    ZERO.append(i)
for i in range(len(ZERO)):
  CK.append(T[ZERO[i]])
U=T[:]
while sum(CK)!=0:
  for i in range(1,len(S)):
    if T[i-1]>0 and S[i-1]=="R":
      U[i]=U[i]+T[i-1]
      U[i-1]=U[i-1]-T[i-1]
    if T[i]>0 and S[i]=="L":
      U[i-1]=U[i-1]+T[i]
      U[i]=U[i]-T[i]
  odd=odd+1
  for i in range(len(ZERO)):
    CK[i]=U[ZERO[i]]
  T=U[:]
if odd%2==0:
  print(" ".join(map(str,T)))
else:
  for i in range(1,len(S)):
    if T[i-1]>0 and S[i-1]=="R":
      U[i]=U[i]+T[i-1]
      U[i-1]=U[i-1]-T[i-1]
    if T[i]>0 and S[i]=="L":
      U[i-1]=U[i-1]+T[i]
      U[i]=U[i]-T[i]
  print(" ".join(map(str,U)))

Fixed submission:
S=list(map(str,input()))
N=len(S)
Q=[0]*N
R=[]
R1=[0]*N
L1=[0]*N
L=[]
V=[0]*N
for i in range(0,N):
  if S[i]=="R" and S[i+1]=="L":
    R.append(i)
  elif S[i]=="L" and S[i-1]=="R":
    L.append(i)
  else: V[i]=1

for i in R+L:
  Q[i]=1

x=0
for r in R:
  while x!=r:
    R1[x]=r
    x=x+1
x=N-1
for l in reversed(L):
  while x!=l:
    L1[x]=l
    x=x-1

for i in range(N):
  if V[i]==1:
    if S[i]=="R":
      if (R1[i]-i)%2==0:
        Q[R1[i]]=Q[R1[i]]+1
      else:
        Q[R1[i]+1]=Q[R1[i]+1]+1
    else:
      if (i-L1[i])%2==0:
        Q[L1[i]]=Q[L1[i]]+1
      else:
        Q[L1[i]-1]=Q[L1[i]-1]+1

print(*Q)

Buggy python submission (verdict: Time Limit Exceeded):
S=list(map(str,input()))
ZERO=[]
T=[]
U=[]
CK=[]
odd=0
for i in range(len(S)):
  T.append(1)
for i in range(1,len(S)):
  if S[i-1]=="R" and S[i]=="R":
    ZERO.append(i-1)
  if S[i]=="L" and S[i-1]=="L":
    ZERO.append(i)
for i in range(len(ZERO)):
  CK.append(T[ZERO[i]])
U=T[:]
while sum(CK)!=0:
  for i in range(1,len(S)):
    if T[i-1]>0 and S[i-1]=="R":
      U[i]=U[i]+T[i-1]
      U[i-1]=U[i-1]-T[i-1]
    if T[i]>0 and S[i]=="L":
      U[i-1]=U[i-1]+T[i]
      U[i]=U[i]-T[i]
  odd=odd+1
  for i in range(len(ZERO)):
    CK[i]=U[ZERO[i]]
  T=U[:]
if odd%2==0:
  print(" ".join(map(str,T)))
else:
  for i in range(1,len(S)):
    if T[i-1]>0 and S[i-1]=="R":
      U[i]=U[i]+T[i-1]
      U[i-1]=U[i-1]-T[i-1]
    if T[i]>0 and S[i]=="L":
      U[i-1]=U[i-1]+T[i]
      U[i]=U[i]-T[i]
  T=U[:]
  print(" ".join(map(str,T)))

Fixed submission:
S=list(map(str,input()))
N=len(S)
Q=[0]*N
R=[]
R1=[0]*N
L1=[0]*N
L=[]
V=[0]*N
for i in range(0,N):
  if S[i]=="R" and S[i+1]=="L":
    R.append(i)
  elif S[i]=="L" and S[i-1]=="R":
    L.append(i)
  else: V[i]=1

for i in R+L:
  Q[i]=1

x=0
for r in R:
  while x!=r:
    R1[x]=r
    x=x+1
x=N-1
for l in reversed(L):
  while x!=l:
    L1[x]=l
    x=x-1

for i in range(N):
  if V[i]==1:
    if S[i]=="R":
      if (R1[i]-i)%2==0:
        Q[R1[i]]=Q[R1[i]]+1
      else:
        Q[R1[i]+1]=Q[R1[i]+1]+1
    else:
      if (i-L1[i])%2==0:
        Q[L1[i]]=Q[L1[i]]+1
      else:
        Q[L1[i]-1]=Q[L1[i]-1]+1

print(*Q)