s=input()+' ';b='';l=[' '];c=m=0 for i in s: if i=='w':c+=1 else: if c>m and b: m=c;l=[] if c>0: if c==m:l+=[b] b='';c=0 b+=i for i in l:print(i)