from collections import defaultdict def solve(): S = input() if "w" not in S or len(set(S)) == 1: return [] S += '_' m = defaultdict(list) s = "" cnt = 0 flg = True for a in S[::-1] + "w": if flg: if a == "w": cnt += 1 else: flg = False s = a else: if a == "w": flg = True m[cnt] += [s[::-1]] cnt = 1 else: s += a return max(m.items())[1] w = solve() if w == []: print("") else: print(*w, sep="\n")