#!/usr/bin/env python3 #coding:utf-8 from __future__ import unicode_literals import math from sys import stdin # import numpy as np # from matplotlib import pyplot as plt def main(): read=stdin.readline #edit here! s=read() cnt=0 maxv=0 x="" ans=[] for i in s: if i=='w': cnt+=1 else: if x!="" and maxv < cnt: maxv=cnt ans=[] ans.append(x) elif cnt>0 and maxv==cnt: ans.append(x) if cnt==0: x+=i else: x=i cnt=0 for i in ans: print(i) if __name__ == '__main__': main()