# coding: utf-8 S = str(input()) ans = 0 temp = 0 st = 0 while S[st] == "w": st += 1 if st == len(S): break for k in range(st,len(S)): if S[k] == "w" and S[k-1] != "w": temp = 1 elif S[k] == S[k-1] == "w": temp += 1 else: temp = 0 ans = max(ans,temp) if ans == 0: print("") exit() kotae = [] S = S[::-1] if S[0] == "w": temp = 1 else: temp = 0 for k in range(1,len(S)): if S[k] == "w" and S[k-1] == "w": temp += 1 elif S[k] != "w" and S[k-1] == "w" and temp == ans: st = k ed = k+1 elif S[k] != "w" and S[k-1] != "w" and temp == ans: ed += 1 elif S[k] == "w" and S[k-1] != "w" and temp == ans: kotae.append(S[st:ed]) temp = 1 elif S[k] == "w" and S[k-1] != "w": temp = 1 if temp == ans and S[len(S)-1] != "w": kotae.append(S[st:ed]) kotae = reversed(kotae) if kotae: for words in kotae: print(words[::-1]) else: print("")