import re from collections import defaultdict S = input() warota = re.findall(r'[^w]+w+', S) count = defaultdict(list) if warota: for w in warota: c = w.count('w') i = w.index('w') count[c].append(w[0:i]) m = max(count.keys()) for ans in count[m]: print(ans) else: print('')