S = input() w = 'w' while S and S[0] == w: S = S[1:] max_wcnt = 0 cands = [] p = 0 while (q := S.find(w, p)) != -1: i = q while i < len(S) and S[i] == w: i += 1 if i-q > max_wcnt: max_wcnt = i-q cands.clear() if i-q == max_wcnt: cands.append(q) p = i for i in cands: p = i-1 res = [] while p >= 0 and S[p] != w: res.append(S[p]) p -= 1 print(''.join(reversed(res)))