s = input() s += "あ" t = "" ans = "" ans_list = [] maxans = 0 w = 0 status = 0 for i in s: if status == 0 and i == "w": status = 1 w = 1 elif status == 0 and i != "w": t += i elif status == 1 and i == "w": w += 1 elif status == 1 and i != "w": status = 0 if t != "": ans_list.append((w, t)) t = i if ans_list == []: print("") else: for i in ans_list: maxans = max(maxans, i[0]) for i in ans_list: if maxans == i[0]: print(i[1])