import re def solve(): s = re.sub(r"^w+", "", input()) if s.count("w") == 0: print("") return True removeW = re.sub(r"w+", "w", s) splitList = removeW.split("w") matchwords = re.findall(r"w+", s) maxW = max([len(c) for c in matchwords]) idxlist = [] for i in range(len(matchwords)): if len(matchwords[i]) == maxW: idxlist.append(i) print("\n".join([splitList[i] for i in idxlist])) return True if __name__=="__main__": solve()