import re def solve(): s = input() if s.count("w") == 0 or s.count("w") == len(s): print("") return True removeW = re.sub(r"w+", "|", s) splitList = removeW.split("|") 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()