import sys read = sys.stdin.buffer.read readline = sys.stdin.buffer.readline readlines = sys.stdin.buffer.readlines S = readline().decode().strip() while S.startswith('w'): S = S[1:] print(S) cans = [] is_w = False t = "" for s in S: if s == 'w': is_w = True elif is_w and s != 'w': cans.append(t) is_w = False t = "" t += s cans.append(t) res = [] for can in cans: cnt = can.count('w') res.append([cnt, can.replace('w', '')]) res = sorted(res) x = res[-1][0] for r in res: if r[0] == x: print(r[1])