s = input().lstrip('w') sub = s[0] lst = [] for i in range(1, len(s)): if (s[i-1] == 'w') ^ (s[i] == 'w'): lst.append(sub) sub = s[i] else : sub += s[i] lst.append(sub) ans = [] max = 0 for i in range(len(lst) // 2): length = len(lst[i * 2 + 1]) if length == max: ans.append(lst[i * 2]) elif length > max: max = length ans = [lst[i * 2]] for ss in ans: print(ss)