import sys input=lambda: sys.stdin.readline().rstrip() S=input() while True: if S[0]=="w": S=S[1:] else: break A=[] B=[] cur="" ct=0 for s in S: if s=="w" and ct==0: A.append(cur) cur="" ct=1 elif s=="w": ct+=1 elif ct!=0: B.append(ct) cur+=s ct=0 else: cur+=s ct=0 B.append(ct) n=len(A) m=max(B) for i in range(n): if B[i]==m: print(A[i])