Buggy python submission (verdict: Time Limit Exceeded):
def move(S, v):
    next = [0 for _ in range(len(S))]
    for i in range(len(S)):
        if S[i] == 'R':
            next[i + 1] += v[i]
        else:
            next[i - 1] += v[i]
    return next
S = input()
V = [1 for _ in range(len(S))]
count = 1

history = {tuple(V):1}
while(True):
    count += 1
    next = move(S, V)
    if tuple(next) in history:
        freq = count - history[tuple(next)]
        res = 1
        if freq > 0:
            for i in range(100):
                res = (res * 10) % freq
            for i in range(res + (count % freq)):
                V = move(S,V)
        print(' '.join([str(i) for i in V]))
        break
    V = next
    history[tuple(V)] = count


Fixed submission:
S = input()
N = len(S)
V = [0 for _ in range(len(S))]
Vi = V[:]
def move(S, v):
    next = [0 for _ in range(len(S))]
    for i in range(len(S)):
        if S[i] == 'R':
            next[i + 1] += v[i]
        else:
            next[i - 1] += v[i]
    return next

nearestL = V[:]
nearestR = V[:]
lastL = N - 1
lastR = 0

for i in range(N - 1, -1, -1):
    if S[i] == 'L':
        lastL = i
    else:
        nearestL[i] = lastL
for i in range(N):
    if S[i] == 'R':
        lastR = i
    else:
        nearestR[i] = lastR

count = 0

maxTurn = 0
for i in range(N):
    if S[i] == 'R':
        dist = abs(i - nearestL[i])
        vec = V if dist % 2 == 0 else Vi
        vec[nearestL[i]] += 1
        maxTurn = max(maxTurn, dist)
    else:
        dist = abs(i - nearestR[i])
        vec = V if dist % 2 == 0 else Vi
        vec[nearestR[i]] += 1
        maxTurn = max(maxTurn, dist)
# print(maxTurn)
# print(' '.join(S))
# print(' '.join([str(i) for i in V]))
# print(' '.join([str(i) for i in Vi]))

Vi = move(S, Vi)
for i in range(N):
    V[i] += Vi[i]

# if (maxTurn % 2 == 1):
#     V = move(S, V)
print(' '.join([str(i) for i in V]))

Buggy python submission (verdict: Time Limit Exceeded):
def move(S, v):
    next = [0 for _ in range(len(S))]
    for i in range(len(S)):
        if S[i] == 'R':
            next[i + 1] += v[i]
        else:
            next[i - 1] += v[i]
    return next
S = input()

V = [1 for _ in range(len(S))]
Vi = move(S,V)
count = 1
while(True):
    next = move(S, Vi)
    count += 1
    if next == V:
        if count %2 == 1:
            result = Vi
        else:
            result = V
        print(' '.join([str(i) for i in result]))
        break
    Vi, V = next, Vi


Fixed submission:
S = input()
N = len(S)
V = [0 for _ in range(len(S))]
Vi = V[:]
def move(S, v):
    next = [0 for _ in range(len(S))]
    for i in range(len(S)):
        if S[i] == 'R':
            next[i + 1] += v[i]
        else:
            next[i - 1] += v[i]
    return next

nearestL = V[:]
nearestR = V[:]
lastL = N - 1
lastR = 0

for i in range(N - 1, -1, -1):
    if S[i] == 'L':
        lastL = i
    else:
        nearestL[i] = lastL
for i in range(N):
    if S[i] == 'R':
        lastR = i
    else:
        nearestR[i] = lastR

count = 0

maxTurn = 0
for i in range(N):
    if S[i] == 'R':
        dist = abs(i - nearestL[i])
        vec = V if dist % 2 == 0 else Vi
        vec[nearestL[i]] += 1
        maxTurn = max(maxTurn, dist)
    else:
        dist = abs(i - nearestR[i])
        vec = V if dist % 2 == 0 else Vi
        vec[nearestR[i]] += 1
        maxTurn = max(maxTurn, dist)
# print(maxTurn)
# print(' '.join(S))
# print(' '.join([str(i) for i in V]))
# print(' '.join([str(i) for i in Vi]))

Vi = move(S, Vi)
for i in range(N):
    V[i] += Vi[i]

# if (maxTurn % 2 == 1):
#     V = move(S, V)
print(' '.join([str(i) for i in V]))