s = input() + "+" while s and s[0] == "w": s = s[1:] ans = [] mxc = 0 curc = 0 sent = "" for si in s: if si == "w": curc += 1 else: if curc > 0: if curc == mxc: ans.append(sent) elif curc > mxc: ans = [sent] mxc = max(mxc, curc) curc = 0 sent = "" sent += si for a in ans: print(a)