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