w = "w" S = input() + "_" S = S.lstrip(w).split(w) if len(S) == 1: print() exit() cnt = [[] for _ in range(100)] c = 0 b = "" for s in S: if s != "": cnt[c].append(b) b = s c = 0 else: c += 1 for i in range(99, -1, -1): if cnt[i]: print(*cnt[i], sep="\n") break