def solve(): s = re.sub(r"^w+", "", input()) if s.count("w") == 0: print("") exit(0) 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 = [i for i in range(len(matchwords)) if len(matchwords[i]) == maxW] print("\n".join([splitList[i] for i in idxlist])) if __name__=="__main__": solve()