Buggy python submission (verdict: Time Limit Exceeded):
import copy
N = list(input())
nums = len(N)
mass = [1 for _ in range(nums)]

prev = N[0]
dicr = []
dicl = []
all = []
for i in range(1, len(N)):
  if prev == "R" and N[i] == "L":
    dicr.append(i-1)
    dicl.append(i)
    all.append(i)
    all.append(i-1)
  prev = N[i]
all = set(all)
dicr = sorted(dicr)
dicl = sorted(dicl,reverse=True)
for i in range(len(N)):
  if i not in all:
    mass[i] = 0
    if N[i] == "R":
      for k in dicr:
        if i < k:
          rest = k-i
          if rest%2 == 0:
            mass[k] += 1
          else:
            mass[k+1] += 1
          break
    else:
      for k in dicl:
        if i > k:
          rest = i-k
          if rest%2 == 0:
            mass[k] += 1
          else:
            mass[k-1] += 1
          break
mass = [str(m) for m in mass]
print(' '.join(mass))

Fixed submission:
import bisect
N = list(input())
nums = len(N)
mass = [1 for _ in range(nums)]

prev = N[0]
dicr = []
dicl = []
all = []
for i in range(1, len(N)):
  if prev == "R" and N[i] == "L":
    dicr.append(i-1)
    dicl.append(i)
    all.append(i)
    all.append(i-1)
  prev = N[i]
all = set(all)
dicr = sorted(dicr)
dicl = sorted(dicl)
for i in range(len(N)):
  if i not in all:
    mass[i] = 0
    if N[i] == "R":
      ind = dicr[bisect.bisect_left(dicr, i)]
      rest = ind-i
      if rest%2 == 0:
        mass[ind] += 1
      else:
        mass[ind+1] += 1
    else:
      ind = dicl[bisect.bisect_left(dicl, i)-1]
      rest = ind-i
      if rest%2 == 0:
        mass[ind] += 1
      else:
        mass[ind-1] += 1
mass = [str(m) for m in mass]
print(' '.join(mass))

Buggy python submission (verdict: Time Limit Exceeded):
import copy
N = list(input())
nums = len(N)
mass = [1 for _ in range(nums)]

prev = N[0]
dicr = {}
dicl = {}
for i in range(1, len(N)):
  if prev == "R" and N[i] == "L":
    dicr[i-1] = True
    dicl[i] = True
  prev = N[i]
for i in range(len(N)):
  if i not in dicr and i not in dicl:
    mass[i] = 0
    if N[i] == "R":
      for k, v in sorted(dicr.items()):
        if i < k:
          rest = k-i
          if rest%2 == 0:
            mass[k] += 1
          else:
            mass[k+1] += 1
          break
    else:
      for k, v in sorted(dicl.items(), reverse=True):
        if i > k:
          rest = i-k
          if rest%2 == 0:
            mass[k] += 1
          else:
            mass[k-1] += 1
          break
mass = [str(m) for m in mass]
print(' '.join(mass))

Fixed submission:
import bisect
N = list(input())
nums = len(N)
mass = [1 for _ in range(nums)]

prev = N[0]
dicr = []
dicl = []
all = []
for i in range(1, len(N)):
  if prev == "R" and N[i] == "L":
    dicr.append(i-1)
    dicl.append(i)
    all.append(i)
    all.append(i-1)
  prev = N[i]
all = set(all)
dicr = sorted(dicr)
dicl = sorted(dicl)
for i in range(len(N)):
  if i not in all:
    mass[i] = 0
    if N[i] == "R":
      ind = dicr[bisect.bisect_left(dicr, i)]
      rest = ind-i
      if rest%2 == 0:
        mass[ind] += 1
      else:
        mass[ind+1] += 1
    else:
      ind = dicl[bisect.bisect_left(dicl, i)-1]
      rest = ind-i
      if rest%2 == 0:
        mass[ind] += 1
      else:
        mass[ind-1] += 1
mass = [str(m) for m in mass]
print(' '.join(mass))

Buggy python submission (verdict: Time Limit Exceeded):
import copy
N = list(input())
nums = len(N)
mass = [1 for _ in range(nums)]

dic = {}
dic2 = {}
for k in range(10**100):
  tmp = copy.deepcopy(mass)
  for i in range(nums):
    if N[i] == "R":
      mass[i+1] += tmp[i]
      mass[i] -= tmp[i]
    if N[i] == "L":
      mass[i-1] += tmp[i]
      mass[i] -=tmp[i]
  if tuple(mass) in dic:
    break
  else:
    dic[tuple(mass)] = k+1
    dic2[k+1] = copy.deepcopy(mass)
if dic[tuple(mass)] == k:
  mass = [str(m) for m in mass]
  print(" ".join(mass))
elif dic[tuple(mass)] == k-1:
  rest = 10**100 -k
  amari = rest % 2
  if amari == 0:
    mass = dic2[k]
    mass = [str(m) for m in mass]
    print(" ".join(mass))
  else:
    mass = dic2[k-1]
    mass = [str(m) for m in mass]
    print(" ".join(mass))

Fixed submission:
import bisect
N = list(input())
nums = len(N)
mass = [1 for _ in range(nums)]

prev = N[0]
dicr = []
dicl = []
all = []
for i in range(1, len(N)):
  if prev == "R" and N[i] == "L":
    dicr.append(i-1)
    dicl.append(i)
    all.append(i)
    all.append(i-1)
  prev = N[i]
all = set(all)
dicr = sorted(dicr)
dicl = sorted(dicl)
for i in range(len(N)):
  if i not in all:
    mass[i] = 0
    if N[i] == "R":
      ind = dicr[bisect.bisect_left(dicr, i)]
      rest = ind-i
      if rest%2 == 0:
        mass[ind] += 1
      else:
        mass[ind+1] += 1
    else:
      ind = dicl[bisect.bisect_left(dicl, i)-1]
      rest = ind-i
      if rest%2 == 0:
        mass[ind] += 1
      else:
        mass[ind-1] += 1
mass = [str(m) for m in mass]
print(' '.join(mass))