# coding:utf-8 s = input() w = "w" while s[0]==w: s = s[1:] count_w = 0 max_w = 0 word = "" ans = [] for i in range(len(s)): if s[i]==w: count_w += 1 else: if count_w > max_w: max_w = count_w ans = [] ans.append(word) elif count_w == max_w and count_w > 0: ans.append(word) if count_w != 0: word = "" count_w = 0 word += s[i] if count_w > max_w: max_w = count_w ans = [] ans.append(word) elif count_w == max_w: ans.append(word) # print(max_w,ans) for i in range(len(ans)): print(ans[i])