import random import time import copy import io, sys s = input() list1 = [] buf = [] cnt = 0 for c in s: if (c == 'w'): cnt += 1 elif (c != 'w' and cnt != 0): if (len(buf) > 0): list1.append((''.join(buf), cnt)) buf = [c] cnt = 0 else: buf.append(c) if (cnt != 0): list1.append((''.join(buf), cnt)) list1.sort(key=lambda t:t[1], reverse=True) #print(list1) if (len(list1) > 0 and list1[0][1] > 0): for t in list1: if (t[1] != list1[0][1]): break if (t[0] != ""): print(t[0])