s = input() while s and s[0]=="w": s = s[1:] res = [] now = "" c = 0 for i in s: if i != "w": if c: res.append(c) c = 0 now += i else: if now: res.append(now) now = "" c += 1 if now: res.append(now) if c: res.append(c) ans = [] num = 0 for i,j in zip(res[::2],res[1::2]): if num < j: ans = [i] num = j elif num==j: ans.append(i) for i in ans: print(i)