#!/usr/bin/env python
#coding:utf8

def read():
    return raw_input().decode('utf-8')


def work(s):
    ansList = []
    maxLeng = 0
    idx = len(s) - 1
    
    while idx >= 0:
        cnt = 0
        while idx >= 0 and s[idx] == 'w'.decode('utf-8'):
            cnt += 1
            idx -= 1

        toPush = ''
        while idx >= 0 and s[idx] != 'w'.decode('utf-8'):
            toPush += s[idx]
            idx -= 1
        toPush = toPush[::-1].encode('utf-8')    

        if cnt == 0 or len(toPush) == 0:
            continue
        
        if maxLeng < cnt:
            ansList = [toPush]
            maxLeng = cnt
        elif maxLeng == cnt:
            ansList.append(toPush)

    print "\n".join(ansList[::-1])

    
if __name__ == "__main__":
    work(read())