import re S = input() w = 'w' reg = re.compile('^[^w]*w+') s = S cands = [] while m := reg.match(s): t = m.group(0) if t[0] != w: cands.append((t, t.count(w))) s = s[len(t):] if not cands: print() exit() _, max_wcnt = max(cands, key=lambda x: x[1]) for s, wcnt in cands: if wcnt == max_wcnt: print(s[:-wcnt])