#!/usr/bin/env python3 import re from itertools import takewhile s = input() ws = re.split('w(?=[^w]|$)', s) ws = list(filter(lambda w: len(w) and w[0] != 'w' and w[-1] == 'w', ws)) ws = list(map(lambda w: (w + 'w').partition('w'), ws)) ws = list(sorted(ws, key=lambda p: len(p[2]), reverse=True)) ws = list(takewhile(lambda p: len(p[2]) == len(ws[0][2]), ws)) ws = list(map(lambda p: p[0], ws)) list(map(print, ws))