# -*- coding: utf-8 -*- s = input() n = len(s) if s.count('w') == n: print('') exit() li = [0] * n ma = 0 flag = False cnt = 0 for i in range(n): if flag and s[i] == 'w': cnt += 1 elif not flag and s[i] == 'w': flag = True cnt += 1 elif flag and s[i] != 'w': flag = False ma = max(ma, cnt) li[i-1] = cnt cnt = 0 ma = max(ma, cnt) li[n-1] = cnt li.reverse() s = s[::-1] ans = [] t = '' flag = False i = 0 while i < n: if flag and s[i] != 'w': t += s[i] i += 1 continue if flag and s[i] == 'w': flag = False ans.append(t) t = '' if li[i] == ma: flag = True i += ma continue i += 1 if t != '': ans.append(t) if ans != []: for x in ans[::-1]: print(x[::-1]) else: print('')