import re S = input() ans = [] max_w = 0 pos = 0 for m in re.finditer('w+', S): nw = len(m.group()) part = S[pos:m.start()] if m.start() == 0: pass elif nw > max_w: max_w = nw ans = [part] elif nw == max_w: ans.append(part) pos = m.end() for s in ans: print(s)