shunak
4/8/2018 - 12:10 PM

logic_summoner Press

logic_summoner Press

n=input()
b=[]
counter=0

for i in range(len(n)):
    if i!=len(n)-1:
        if n[i]==n[i+1]:
            counter+=1
        if n[i]!=n[i+1]:
            counter+=1
            b.append(counter)
            counter=0
            
b.append(counter)
b[len(b)-1]=b[len(b)-1]+1         

if n[0]=="w":
    b.insert(0,0)

print(*b,sep=" ")