s = input() w = 0 t = '' l = [] for i in s: if i != 'w' and w == 0: t += i elif i == 'w': w += 1 else: if t != '': l.append([w, t]) t = i w = 0 else: l.append([w, t]) l2 = sorted(l)[::-1] x = l2[0][0] for i in l: if i[0] == x: print(i[1])