Buggy python submission (verdict: Runtime Error):
s = input()
n = len(s)
up = []
down = []
for i in range(1,n):
  if s[i] != s[i-1]:
    if s[i] == 'L':
      down.append(i)
    else:
      up.append(i)
ans = [0 for _ in range(n)]
try:
  top = up[0]
except:
  top = n
bottom = down[0]
count = 0
for i in range(n):
  diff = i - bottom
  if diff % 2 == 0:
    ans[bottom] += 1
  else:
    ans[bottom-1] += 1
  #print(ans)
  if i+1 == top:
    count += 1
    try:
      top = up[count]
    except:
      pass
    bottom = down[count]
print(' '.join(map(str,ans)))

Fixed submission:
s = input()
n = len(s)
up = []
down = []
parity = 0
for i in range(1,n):
  if s[i] != s[i-1]:
    if parity == 0:
      down.append(i)
    else:
      up.append(i)
    parity = 1 - parity
ans = [0 for i in range(n)]
#print(up,down)
for i in range(n):
  if s[i] == 'R':
    diff = down[0] - i
    if diff % 2 == 1:
      ans[down[0]-1] += 1
    else:
      ans[down[0]] += 1
  else:
    diff = i - down[0]
    if diff % 2 == 1:
      ans[down[0]-1] += 1
    else:
      ans[down[0]] += 1
  if up != []:
    if i+1 == up[0]:
      del down[0]
      del up[0]
ANS = list(map(str,ans))
print(' '.join(ANS))

Buggy python submission (verdict: Runtime Error):
s = input()
n = len(s)
up = []
down = []
for i in range(1,n):
  if s[i] != s[i-1]:
    if s[i] == 'L':
      down.append(i)
    else:
      up.append(i)
ans = [0 for _ in range(n)]
top = up[0]
bottom = down[0]
count = 0
for i in range(n):
  diff = i - bottom
  if diff % 2 == 0:
    ans[bottom] += 1
  else:
    ans[bottom-1] += 1
  #print(ans)
  if i+1 == top:
    count += 1
    try:
      top = up[count]
    except:
      pass
    bottom = down[count]
print(' '.join(map(str,ans)))

Fixed submission:
s = input()
n = len(s)
up = []
down = []
parity = 0
for i in range(1,n):
  if s[i] != s[i-1]:
    if parity == 0:
      down.append(i)
    else:
      up.append(i)
    parity = 1 - parity
ans = [0 for i in range(n)]
#print(up,down)
for i in range(n):
  if s[i] == 'R':
    diff = down[0] - i
    if diff % 2 == 1:
      ans[down[0]-1] += 1
    else:
      ans[down[0]] += 1
  else:
    diff = i - down[0]
    if diff % 2 == 1:
      ans[down[0]-1] += 1
    else:
      ans[down[0]] += 1
  if up != []:
    if i+1 == up[0]:
      del down[0]
      del up[0]
ANS = list(map(str,ans))
print(' '.join(ANS))

Buggy python submission (verdict: Runtime Error):
s = input()
n = len(s)
up = []
down = []
parity = 0
for i in range(1,n):
  if s[i] != s[i-1]:
    if parity == 0:
      down.append(i)
    else:
      up.append(i)
    parity = 1 - parity
ans = [0 for i in range(n)]
count = 0
top = up[0]
bottom = down[0]
for i in range(n):
  diff = down[0] - i
  if diff % 2 == 1:
    ans[bottom-1] += 1
  else:
    ans[bottom] += 1
  if len(up) > count + 1:
    if i+1 == top:
      count += 1
      top = up[count]
      bottom = down[count]
ANS = list(map(str,ans))
print(' '.join(ANS))

Fixed submission:
s = input()
n = len(s)
up = []
down = []
parity = 0
for i in range(1,n):
  if s[i] != s[i-1]:
    if parity == 0:
      down.append(i)
    else:
      up.append(i)
    parity = 1 - parity
ans = [0 for i in range(n)]
#print(up,down)
for i in range(n):
  if s[i] == 'R':
    diff = down[0] - i
    if diff % 2 == 1:
      ans[down[0]-1] += 1
    else:
      ans[down[0]] += 1
  else:
    diff = i - down[0]
    if diff % 2 == 1:
      ans[down[0]-1] += 1
    else:
      ans[down[0]] += 1
  if up != []:
    if i+1 == up[0]:
      del down[0]
      del up[0]
ANS = list(map(str,ans))
print(' '.join(ANS))