import re from collections import defaultdict def main(): s = input().lstrip("w") if "w" not in s: print() return d = defaultdict(list) l = re.split(r"[^w]+", s) for i in range(len(l)): d[len(l[i])].append(i) w = re.split(r"w+", s) for i in d[max(d.keys())]: print(w[i - 1]) if __name__ == '__main__': main()