S = input() i, mx = 0, 0 n = len(S) stk = '' ans = [] while i < n: p = i while i < n and S[i] == S[p]: i += 1 if S[p] == 'w': if i - p > mx: mx = i - p ans.clear() if i - p == mx: ans.append(stk) stk = '' else: for j in range(p, i): stk += S[j] for s in ans: print(s)