Buggy python submission (verdict: Time Limit Exceeded):
S = list(input())
N = len(S)
child = [1] * N
memo = []

# RLのインデックスを取得する
for i in range(N-1):
    if S[i] == "R" and S[i+1] == "L":
        memo.append(i)
        memo.append(i+1)

count = 0
for i in range(N):
    if i not in memo:
        if S[i] == "R":
            if (memo[count] - i) % 2 == 0:
                child[memo[count]] += 1
                child[i] -= 1
            else:
                child[memo[count+1]] += 1
                child[i] -= 1
        elif S[i] == "L":
            if (i - memo[count-1]) % 2 == 0:
                child[memo[count-1]] += 1
                child[i] -= 1
            else:
                child[memo[count-2]] += 1
                child[i] -= 1
    else:
        count += 1

ans = [str(n) for n in child]
ans = " ".join(ans)
print(ans)

Fixed submission:
S = list(input())
N = len(S)
child = [1] * N
memo = []

# RLのインデックスを取得する
for i in range(N-1):
    if S[i] == "R" and S[i+1] == "L":
        memo.append(i)
        memo.append(i+1)
memo.append("dummy")
count = 0
for i in range(N):
    if i != memo[count]:
        if S[i] == "R":
            if (memo[count] - i) % 2 == 0:
                child[memo[count]] += 1
                child[i] -= 1
            else:
                child[memo[count+1]] += 1
                child[i] -= 1
        elif S[i] == "L":
            if (i - memo[count-1]) % 2 == 0:
                child[memo[count-1]] += 1
                child[i] -= 1
            else:
                child[memo[count-2]] += 1
                child[i] -= 1
    else:
        count += 1

ans = [str(n) for n in child]
ans = " ".join(ans)
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
S = list(input())
N = len(S)
child = [1] * N
memo = []

# RLのインデックスを取得する
for i in range(N-1):
    if S[i] == "R" and S[i+1] == "L":
        memo.append(i)
        memo.append(i+1)

count = 0
for i in range(N):
    if i not in memo:
        if S[i] == "R":
            if (memo[count] - i) % 2 == 0:
                child[memo[count]] += 1
                child[i] -= 1
            else:
                child[memo[count+1]] += 1
                child[i] -= 1
        elif S[i] == "L":
            if (i - memo[count-1]) % 2 == 0:
                child[memo[count-1]] += 1
                child[i] -= 1
            else:
                child[memo[count-2]] += 1
                child[i] -= 1
    else:
        count += 1

ans = [str(n) for n in child]
ans = " ".join(ans)
print(ans)

Fixed submission:
S = list(input())
N = len(S)
child = [1] * N
memo = []

# RLのインデックスを取得する
for i in range(N-1):
    if S[i] == "R" and S[i+1] == "L":
        memo.append(i)
        memo.append(i+1)
memo.append("dummy")
count = 0
for i in range(N):
    if i != memo[count]:
        if S[i] == "R":
            if (memo[count] - i) % 2 == 0:
                child[memo[count]] += 1
                child[i] -= 1
            else:
                child[memo[count+1]] += 1
                child[i] -= 1
        elif S[i] == "L":
            if (i - memo[count-1]) % 2 == 0:
                child[memo[count-1]] += 1
                child[i] -= 1
            else:
                child[memo[count-2]] += 1
                child[i] -= 1
    else:
        count += 1

ans = [str(n) for n in child]
ans = " ".join(ans)
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
S = list(input())
N = len(S)
child = [1] * N

# 最初のR
count = 0
for i in range(N):
    count += 1
    if S[i] == "R" and S[i+1] == "L":
        if count % 2 != 0:
            child[0] -= 1
            child[i] += 1
        else:
            child[0] -= 1
            child[i+1] += 1
        break

for i in range(1, N-1):
    if (S[i] == "R" and S[i+1] == "L") or (S[i] == "L" and S[i-1] == "R"):
        continue
    else:
        if S[i] == "R":
            count = 0
            for j in range(i,N):
                count += 1
                if S[j] == "R" and S[j+1] == "L":
                    # 偶数の場合
                    if count % 2 != 0:
                        child[i] -= 1
                        child[j] += 1
                    else:
                        child[i] -= 1
                        child[j+1] += 1
                    break

        elif S[i] == "L":
            count = 0
            for j in reversed(range(i)):
                count += 1
                if S[j] == "L" and S[j-1] == "R":
                    # 偶数の場合
                    if count % 2 == 0:
                        child[i] -= 1
                        child[j] += 1
                    else:
                        child[i] -= 1
                        child[j-1] += 1                        
                    break

# 最後のL
count = 0
for i in reversed(range(N)):
    count += 1
    if S[i] == "L" and S[i-1] == "R":
        if count % 2 != 0:
            child[-1] -= 1
            child[i] += 1
        else:
            child[-1] -= 1
            child[i-1] += 1
        break

ans = [str(n) for n in child]
ans = " ".join(ans)
print(ans)

Fixed submission:
S = list(input())
N = len(S)
child = [1] * N
memo = []

# RLのインデックスを取得する
for i in range(N-1):
    if S[i] == "R" and S[i+1] == "L":
        memo.append(i)
        memo.append(i+1)
memo.append("dummy")
count = 0
for i in range(N):
    if i != memo[count]:
        if S[i] == "R":
            if (memo[count] - i) % 2 == 0:
                child[memo[count]] += 1
                child[i] -= 1
            else:
                child[memo[count+1]] += 1
                child[i] -= 1
        elif S[i] == "L":
            if (i - memo[count-1]) % 2 == 0:
                child[memo[count-1]] += 1
                child[i] -= 1
            else:
                child[memo[count-2]] += 1
                child[i] -= 1
    else:
        count += 1

ans = [str(n) for n in child]
ans = " ".join(ans)
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
S = list(input())

N = len(S)
child = [1] * N 
memo = [child]
loopmemo = []

for count in range(1,10**100):
    tmpChild = child[:]
    for i in range(N):
        if S[i] == "R" and child[i] >= 1:
            tmpChild[i+1] += child[i]
            tmpChild[i] -= child[i]

        elif S[i] == "L" and child[i] >= 1:
            tmpChild[i-1] += child[i]
            tmpChild[i] -= child[i]
    if child == tmpChild:
        ans = [str(n) for n in child]
        ans = " ".join(ans)
        print(ans)
        break
    child = tmpChild
    memo.append(child)
    if len(memo) >= 3:
        if memo[count-2] == memo[count]:
            ansNum = count - 2
            loopmemo.append(memo[count])
            loopmemo.append(memo[count-1])
            ans = [str(n) for n in loopmemo[(10 * 100 - ansNum) % 2]]
            ans = " ".join(ans)
            print(ans)
            break


Fixed submission:
S = list(input())
N = len(S)
child = [1] * N
memo = []

# RLのインデックスを取得する
for i in range(N-1):
    if S[i] == "R" and S[i+1] == "L":
        memo.append(i)
        memo.append(i+1)
memo.append("dummy")
count = 0
for i in range(N):
    if i != memo[count]:
        if S[i] == "R":
            if (memo[count] - i) % 2 == 0:
                child[memo[count]] += 1
                child[i] -= 1
            else:
                child[memo[count+1]] += 1
                child[i] -= 1
        elif S[i] == "L":
            if (i - memo[count-1]) % 2 == 0:
                child[memo[count-1]] += 1
                child[i] -= 1
            else:
                child[memo[count-2]] += 1
                child[i] -= 1
    else:
        count += 1

ans = [str(n) for n in child]
ans = " ".join(ans)
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
S = list(input())

N = len(S)
child = [1] * N 
memo = [child]
loopmemo = []

for count in range(1,10**100):
    tmpChild = child[:]
    for i in range(N):
        if S[i] == "R" and child[i] >= 1:
            tmpChild[i+1] += child[i]
            tmpChild[i] -= child[i]

        elif S[i] == "L" and child[i] >= 1:
            tmpChild[i-1] += child[i]
            tmpChild[i] -= child[i]
    if child == tmpChild:
        ans = [str(n) for n in child]
        ans = " ".join(ans)
        print(ans)
        break
    child = tmpChild
    memo.append(child)
    if len(memo) >= 3:
        if memo[count-2] == memo[count]:
            ansNum = count - 2
            loopmemo.append(memo[count])
            loopmemo.append(memo[count-1])
            ans = [str(n) for n in loopmemo[(10 * 100 - ansNum) % 2]]
            ans = " ".join(ans)
            print(ans)
            break


Fixed submission:
S = list(input())
N = len(S)
child = [1] * N
memo = []

# RLのインデックスを取得する
for i in range(N-1):
    if S[i] == "R" and S[i+1] == "L":
        memo.append(i)
        memo.append(i+1)
memo.append("dummy")
count = 0
for i in range(N):
    if i != memo[count]:
        if S[i] == "R":
            if (memo[count] - i) % 2 == 0:
                child[memo[count]] += 1
                child[i] -= 1
            else:
                child[memo[count+1]] += 1
                child[i] -= 1
        elif S[i] == "L":
            if (i - memo[count-1]) % 2 == 0:
                child[memo[count-1]] += 1
                child[i] -= 1
            else:
                child[memo[count-2]] += 1
                child[i] -= 1
    else:
        count += 1

ans = [str(n) for n in child]
ans = " ".join(ans)
print(ans)

Buggy python submission (verdict: Runtime Error):
S = list(input())

N = len(S)
child = [1] * N 
memo = [child]
loopmemo = []

for count in range(1,10**100):
    tmpChild = child.copy()
    for i in range(N):
        if S[i] == "R" and child[i] >= 1:
            tmpChild[i+1] += child[i]
            tmpChild[i] -= child[i]

        elif S[i] == "L" and child[i] >= 1:
            tmpChild[i-1] += child[i]
            tmpChild[i] -= child[i]
    if child == tmpChild:
        ans = [str(n) for n in child]
        ans = " ".join(ans)
        print(ans)
        break
    child = tmpChild
    memo.append(child)
    if len(memo) >= 3:
        if memo[count-2] == memo[count]:
            ansNum = count - 2
            loopmemo.append(memo[count])
            loopmemo.append(memo[count-1])
            ans = [str(n) for n in loopmemo[(10 * 100 - ansNum) % 2]]
            ans = " ".join(ans)
            print(ans)
            break


Fixed submission:
S = list(input())
N = len(S)
child = [1] * N
memo = []

# RLのインデックスを取得する
for i in range(N-1):
    if S[i] == "R" and S[i+1] == "L":
        memo.append(i)
        memo.append(i+1)
memo.append("dummy")
count = 0
for i in range(N):
    if i != memo[count]:
        if S[i] == "R":
            if (memo[count] - i) % 2 == 0:
                child[memo[count]] += 1
                child[i] -= 1
            else:
                child[memo[count+1]] += 1
                child[i] -= 1
        elif S[i] == "L":
            if (i - memo[count-1]) % 2 == 0:
                child[memo[count-1]] += 1
                child[i] -= 1
            else:
                child[memo[count-2]] += 1
                child[i] -= 1
    else:
        count += 1

ans = [str(n) for n in child]
ans = " ".join(ans)
print(ans)