s = input().split('w') result = [] maxcnt = 0 cnt = 0 s.reverse() for v in s: if v == '': cnt += 1 else: if cnt > 0: if maxcnt < cnt: result = [v] maxcnt = cnt elif maxcnt == cnt: result.append(v) cnt = 1 if len(result) > 0: result.reverse() for v in result: print(v) else: print()