import re def solve(): s = input() s = re.sub(r"^\xEF\xBB\xBF", "", s) if s.count("w") == 0 or s.count("w") == len(s): 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 if len(splitList[i]) > 0])) return True if __name__=="__main__": solve()