# -*- coding: utf-8 -*- """ No.342 一番ワロタww https://yukicoder.me/problems/no/342 """ import sys from sys import stdin from collections import defaultdict input = stdin.readline def solve(S): res = defaultdict(list) t = S.split('w') i = 0 w = 0 chunk = '' while True: if t[i] != '': if chunk != '': res[w].append(chunk) chunk = t[i] w = 1 else: w += 1 i += 1 if i >= len(t): if t[-1] == '' or t[-1] == chunk: w -= 1 if chunk != '' and w > 0: res[w].append(chunk) break max_k = 0 for k, v in res.items(): max_k = max(max_k, k) if max_k > 0: return res[max_k] else: return [] def main(args): S = input().strip() ans = solve(S) print(*ans, sep='\n') if __name__ == '__main__': main(sys.argv[1:])