# -*- coding: utf-8 -*- s = input() n = len(s) if s.count('w') in [0, n]: print('') exit() li = [0] * n ma = 0 flag = False cnt = 0 i = 0 while i < n and s[i] == 'w': i += 1 while i < 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 i += 1 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('')