import re import itertools def main(): s = ''.join(itertools.dropwhile(lambda x: x == 'w', input())) pos = 0 xs = [] max_w = 0 for m in re.finditer('w+', s): w = m.end() - m.start() x = s[pos:m.start()] if max_w < w: max_w = w xs = [x] elif max_w == w: xs.append(x) pos = m.end() for x in xs: print(x) if __name__ == "__main__": main()