Buggy python submission (verdict: Runtime Error):
S = list(input())
pair = []
cnt = 0
now = S[0]
s, t = 0, 0
for i in range(1, len(S)-1):
  if now == 'R' and S[i+1] == 'L':
    pair += [[i, i+1]]
    now = 'L'
  if now == 'L' and S[i+1] == 'R':
    pair[-1] += [s, t+1]
    now = 'R'
    s = t+2
  t += 1


pair[-1] += [s, t+1]
result = [0]*len(S)
for a, b, s, t in pair:
  p = t - s + 1
  if p % 2 == 0:
    result[a] = p // 2
    result[b] = p // 2
  else:
    a_even = (a-s)//2 + (t-a)//2 + 1
    b_even = p-a_even
    result[a] = a_even
    result[b] = b_even
result = list(map(str, result))
print(" ".join(result))

Fixed submission:
S = list(input())
pair = []
cnt = 0
now = S[0]
if len(S) == 2:
  print(1, 1)
  exit()
s, t = 0, 0
for i in range(len(S)-1):
  if now == 'R' and S[i+1] == 'L':
    pair += [[i, i+1]]
    now = 'L'
  if now == 'L' and S[i+1] == 'R':
    pair[-1] += [s, t]
    now = 'R'
    s = t+1
  t += 1


pair[-1] += [s, t]
result = [0]*len(S)
for a, b, s, t in pair:
  p = t - s + 1
  if p % 2 == 0:
    result[a] = p // 2
    result[b] = p // 2
  else:
    a_even = (a-s)//2 + (t-a)//2 + 1
    b_even = p-a_even
    result[a] = a_even
    result[b] = b_even
result = list(map(str, result))
print(" ".join(result))

Buggy python submission (verdict: Runtime Error):
S = list(input())
pair = []
cnt = 0
now = S[0]
s, t = 0, 0
for i in range(1, len(S)-1):
  if now == 'R' and S[i+1] == 'L':
    pair += [[i, i+1]]
    now = 'L'
  if now == 'L' and S[i+1] == 'R':
    pair[-1] += [s, t+1]
    now = 'R'
    s = t+2
  t += 1


pair[-1] += [s, t+1]

result = [0]*len(S)
for a, b, s, t in pair:
  p = t - s + 1
  if p % 2 == 0:
    result[a] = p // 2
    result[b] = p // 2
  else:
    if max(a-s, t-b) % 2 == 0:
      result[a] = p // 2 + 1
      result[b] = p // 2
    else:
      result[a] = p // 2 
      result[b] = p // 2 + 1
result = list(map(str, result))
print(" ".join(result))

Fixed submission:
S = list(input())
pair = []
cnt = 0
now = S[0]
if len(S) == 2:
  print(1, 1)
  exit()
s, t = 0, 0
for i in range(len(S)-1):
  if now == 'R' and S[i+1] == 'L':
    pair += [[i, i+1]]
    now = 'L'
  if now == 'L' and S[i+1] == 'R':
    pair[-1] += [s, t]
    now = 'R'
    s = t+1
  t += 1


pair[-1] += [s, t]
result = [0]*len(S)
for a, b, s, t in pair:
  p = t - s + 1
  if p % 2 == 0:
    result[a] = p // 2
    result[b] = p // 2
  else:
    a_even = (a-s)//2 + (t-a)//2 + 1
    b_even = p-a_even
    result[a] = a_even
    result[b] = b_even
result = list(map(str, result))
print(" ".join(result))

Buggy python submission (verdict: Runtime Error):
S = list(input())
pair = []
cnt = 0
now = S[0]
s, t = 0, 0
for i in range(1, len(S)-1):
  
  if now == 'R' and S[i+1] == 'L':
    pair += [[i, i+1]]
    now = 'L'
  if now == 'L' and S[i+1] == 'R':
    pair[-1] += [t+1-s+1]
    now = 'R'
    s = t+2
  t += 1

pair[-1] += [t+1-s+1]
result = [0]*len(S)
for a, b, p in pair:
  if p % 2 == 0:
    result[a] = p // 2
    result[b] = p // 2
  else:
    result[a] = p // 2 + 1
    result[b] = p // 2
result = list(map(str, result))
print(" ".join(result))

Fixed submission:
S = list(input())
pair = []
cnt = 0
now = S[0]
if len(S) == 2:
  print(1, 1)
  exit()
s, t = 0, 0
for i in range(len(S)-1):
  if now == 'R' and S[i+1] == 'L':
    pair += [[i, i+1]]
    now = 'L'
  if now == 'L' and S[i+1] == 'R':
    pair[-1] += [s, t]
    now = 'R'
    s = t+1
  t += 1


pair[-1] += [s, t]
result = [0]*len(S)
for a, b, s, t in pair:
  p = t - s + 1
  if p % 2 == 0:
    result[a] = p // 2
    result[b] = p // 2
  else:
    a_even = (a-s)//2 + (t-a)//2 + 1
    b_even = p-a_even
    result[a] = a_even
    result[b] = b_even
result = list(map(str, result))
print(" ".join(result))