s = input() n = len(s) l = 0 ANS = [] res = 0 cnt = 0 f = 0 for i in range(n): if s[i] == 'w': res += 1 if i == n - 1: if res > l: l = res ANS = [s[f:f + cnt]] elif res == l: ANS.append(s[f:f + cnt]) else: if res == 0: cnt += 1 else: if res > l: l = res ANS = [s[f:f + cnt]] elif res == l: ANS.append(s[f:f + cnt]) f += cnt cnt = 0 res = 0 print(*ANS, sep='\n')