s = input() l = len(s) d = [] w = 'w' a = 0 for i in range(l): if s[i] == w: continue if i != 0 and s[i-1] != w: continue t = "" j = i while j < l and s[j] != w: t += s[j] j += 1 k = 0 while j < l and s[j] == w: #t += s[j] j += 1 k += 1 if a < k: a = k d = [] if a == k: d.append(t) if a == 0: d = [] for x in d: print(x)