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

N=len(S)
M=[]
for s in S:
    if s == 'R':
        M.append(1)
    else:
        M.append(-1)


def move(C):
    D=[0] * N
    for i in range(N):
        D[i+M[i]] += C[i]
    return D


c=[1] * N
even_c = [0] * N

i=0
while True:
    d = move(c)
    if i%2 == 0:
        if c == even_c:
            break
        even_c = c
    c = d
    i+=1

for c in even_c:
    print(str(c)+' ',end='')
print()

Fixed submission:
S=input()

N=len(S)
RLs=[]
Rs=[]
Ls=[]

rlen=0
llen=0
for i in range(N):

    if S[i]=='R':
        rlen+=1
        if S[i:i+2] == 'RL':
            RLs.append(i)
            Rs.append(rlen)
            rlen=0
    elif S[i]=='L':
        llen+=1
        if i==N-1 or S[i:i+2] == 'LR':
            Ls.append(llen)
            llen=0

ans = [0]*N
for i,rlpos in enumerate(RLs):
    rr=-(-Rs[i]//2)
    rl=Rs[i]//2

    lr=Ls[i]//2
    ll=-(-Ls[i]//2)

    ans[rlpos]+=rr+lr
    ans[rlpos+1]+=rl+ll

for a in ans:
    print(str(a)+' ',end='')
print()

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

N=len(S)

M=[1 if s=='R' else -1 for s in S]

def move(C):
    D=[0] * N
    for i in range(N):
        D[i+M[i]] += C[i]
    return D


c=[1] * N
even_c = [0] * N

i=0
while True:
    d = move(c)
    if i%2 == 0:
        if c == even_c:
            break
        even_c = c
    c = d
    i+=1

for c in even_c:
    print(str(c)+' ',end='')
print()

Fixed submission:
S=input()

N=len(S)
RLs=[]
Rs=[]
Ls=[]

rlen=0
llen=0
for i in range(N):

    if S[i]=='R':
        rlen+=1
        if S[i:i+2] == 'RL':
            RLs.append(i)
            Rs.append(rlen)
            rlen=0
    elif S[i]=='L':
        llen+=1
        if i==N-1 or S[i:i+2] == 'LR':
            Ls.append(llen)
            llen=0

ans = [0]*N
for i,rlpos in enumerate(RLs):
    rr=-(-Rs[i]//2)
    rl=Rs[i]//2

    lr=Ls[i]//2
    ll=-(-Ls[i]//2)

    ans[rlpos]+=rr+lr
    ans[rlpos+1]+=rl+ll

for a in ans:
    print(str(a)+' ',end='')
print()

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

N=len(S)
M=[]
for s in S:
    if s == 'R':
        M.append(1)
    else:
        M.append(-1)


def move(C):
    D=[0] * N
    for i in range(N):
        D[i+M[i]] += C[i]
    return D


c=[1] * N
even_c = [0] * N

i=0
while True:
    d = move(c)
    if i%2 == 0:
        if c == even_c:
            break
        even_c = c
    c = d
    i+=1

for c in even_c:
    print(str(c)+' ',end='')
print()

Fixed submission:
S=input()

N=len(S)
RLs=[]
Rs=[]
Ls=[]

rlen=0
llen=0
for i in range(N):

    if S[i]=='R':
        rlen+=1
        if S[i:i+2] == 'RL':
            RLs.append(i)
            Rs.append(rlen)
            rlen=0
    elif S[i]=='L':
        llen+=1
        if i==N-1 or S[i:i+2] == 'LR':
            Ls.append(llen)
            llen=0

ans = [0]*N
for i,rlpos in enumerate(RLs):
    rr=-(-Rs[i]//2)
    rl=Rs[i]//2

    lr=Ls[i]//2
    ll=-(-Ls[i]//2)

    ans[rlpos]+=rr+lr
    ans[rlpos+1]+=rl+ll

for a in ans:
    print(str(a)+' ',end='')
print()

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

N=len(S)
M=[]
for s in S:
    if s == 'R':
        M.append(1)
    else:
        M.append(-1)


def move(C):
    D=[0] * N
    for i in range(N):
        D[i+M[i]] += C[i]
    return D


c=[1] * N
even_c = [0] * N

i=0
while True:
    d = move(c)
    if i%2 == 0:
        if c == even_c:
            break
        even_c = c
    c = d
    i+=1

for c in even_c:
    print(str(c)+' ',end='')
print()

Fixed submission:
S=input()

N=len(S)
RLs=[]
Rs=[]
Ls=[]

rlen=0
llen=0
for i in range(N):

    if S[i]=='R':
        rlen+=1
        if S[i:i+2] == 'RL':
            RLs.append(i)
            Rs.append(rlen)
            rlen=0
    elif S[i]=='L':
        llen+=1
        if i==N-1 or S[i:i+2] == 'LR':
            Ls.append(llen)
            llen=0

ans = [0]*N
for i,rlpos in enumerate(RLs):
    rr=-(-Rs[i]//2)
    rl=Rs[i]//2

    lr=Ls[i]//2
    ll=-(-Ls[i]//2)

    ans[rlpos]+=rr+lr
    ans[rlpos+1]+=rl+ll

for a in ans:
    print(str(a)+' ',end='')
print()

Buggy python submission (verdict: Time Limit Exceeded):
import copy

S=input()

N=len(S)
M=[]
for s in S:
    if s == 'R':
        M.append(1)
    else:
        M.append(-1)


def move(C):
    D=[0] * N
    for i,c in enumerate(C):
        D[i+M[i]] += c
    return D



c=[1] * N
d=[0] * N
even_c = [0] * N

i=0
while True:
    d = move(c)
    if i%2 == 0:
        if c == even_c:
            break
        even_c = c
    c = d
    i+=1

for c in even_c:
    print(str(c)+' ',end='')
print()

Fixed submission:
S=input()

N=len(S)
RLs=[]
Rs=[]
Ls=[]

rlen=0
llen=0
for i in range(N):

    if S[i]=='R':
        rlen+=1
        if S[i:i+2] == 'RL':
            RLs.append(i)
            Rs.append(rlen)
            rlen=0
    elif S[i]=='L':
        llen+=1
        if i==N-1 or S[i:i+2] == 'LR':
            Ls.append(llen)
            llen=0

ans = [0]*N
for i,rlpos in enumerate(RLs):
    rr=-(-Rs[i]//2)
    rl=Rs[i]//2

    lr=Ls[i]//2
    ll=-(-Ls[i]//2)

    ans[rlpos]+=rr+lr
    ans[rlpos+1]+=rl+ll

for a in ans:
    print(str(a)+' ',end='')
print()

Buggy python submission (verdict: Time Limit Exceeded):
import copy

S=input()

N=len(S)
M=[]
for s in S:
    if s == 'R':
        M.append(1)
    else:
        M.append(-1)


def move(C):
    D=[0] * N
    for i,c in enumerate(C):
        D[i+M[i]] += c
    return D



c=[1] * N
d=[0] * N
even_c = [0] * N

i=0
while True:
    d = move(c)
    if c == even_c:
        break
    if i % 2 == 0:
        even_c = c
    c = d
    i+=1

for c in even_c:
    print(str(c)+' ',end='')
print()

Fixed submission:
S=input()

N=len(S)
RLs=[]
Rs=[]
Ls=[]

rlen=0
llen=0
for i in range(N):

    if S[i]=='R':
        rlen+=1
        if S[i:i+2] == 'RL':
            RLs.append(i)
            Rs.append(rlen)
            rlen=0
    elif S[i]=='L':
        llen+=1
        if i==N-1 or S[i:i+2] == 'LR':
            Ls.append(llen)
            llen=0

ans = [0]*N
for i,rlpos in enumerate(RLs):
    rr=-(-Rs[i]//2)
    rl=Rs[i]//2

    lr=Ls[i]//2
    ll=-(-Ls[i]//2)

    ans[rlpos]+=rr+lr
    ans[rlpos+1]+=rl+ll

for a in ans:
    print(str(a)+' ',end='')
print()

Buggy python submission (verdict: Time Limit Exceeded):
import copy

S=input()

N=len(S)
M=[]
for s in S:
    if s == 'R':
        M.append(1)
    else:
        M.append(-1)


def move(C):
    D=[0] * N
    for i,c in enumerate(C):
        D[i+M[i]] += c
    return D



c=[1] * N
d=[0] * N

even_c = [0] * N

i=0
while True:
    d = move(c)
    if c == even_c:
        break
    if i % 2 == 0:
        even_c = copy.deepcopy(c)
    c = d
    i+=1

for c in even_c:
    print(str(c)+' ',end='')
print()

Fixed submission:
S=input()

N=len(S)
RLs=[]
Rs=[]
Ls=[]

rlen=0
llen=0
for i in range(N):

    if S[i]=='R':
        rlen+=1
        if S[i:i+2] == 'RL':
            RLs.append(i)
            Rs.append(rlen)
            rlen=0
    elif S[i]=='L':
        llen+=1
        if i==N-1 or S[i:i+2] == 'LR':
            Ls.append(llen)
            llen=0

ans = [0]*N
for i,rlpos in enumerate(RLs):
    rr=-(-Rs[i]//2)
    rl=Rs[i]//2

    lr=Ls[i]//2
    ll=-(-Ls[i]//2)

    ans[rlpos]+=rr+lr
    ans[rlpos+1]+=rl+ll

for a in ans:
    print(str(a)+' ',end='')
print()