#!/usr/bin/env python indat = input().split('w') indat.reverse() sw = 0 wmax = 0.5 ans = [""] for s in indat: if s == '': sw += 1 elif sw == wmax: ans.append(s) sw = 1 elif sw >= wmax: ans = [s] wmax = sw sw = 1 else: sw = 1 for a in reversed(ans): print(a)