S = input() + ' ' t = '' L = [] cnt = M = 0 for s in S: if s != 'w' and cnt == 0: t += s elif s == 'w': cnt += 1 else: if cnt > M and t: M, L = cnt, [] if cnt > 0: if cnt == M: L += [t] t, cnt = '', 0 t += s for i in L: print(i)