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