s = input() max_word = [""] def cntw(): global max_word max_cnt = 0 cnt = 0 i = len(s)-1 while i>=0: if s[i]=="w": while s[i]=="w": cnt+=1 i-=1 if i<0: return if cnt>=max_cnt: stock = "" while s[i]!="w": stock = s[i] + stock i-=1 if i<0: break if cnt==max_cnt: max_word.append(stock) else: max_cnt=cnt max_word = [stock] cnt=0 else: i-=1 cntw() max_word.reverse() for ans in max_word: print(ans)