S = input() def solve(S): while (S[0] == 'w'): S = S[1:] count = 0 record = 0 words = [] word = '' prev_is_w = True for s in S: if s == 'w': prev_is_w = True count += 1 if count == record: words.append(word) elif count > record: words = [word] record = count else: if prev_is_w: word = '' prev_is_w = False word = word + s count = 0 if words: for word in words: if word: print(word) else: print() wcount = S.count('w') if wcount == 0: print() elif wcount == len(S): print() else: solve(S)