str = input() d = {} s = "" count = 0 for i in str: if i != 'w' and count == 0: s += i elif i == 'w': count += 1 else: d[s] = count s = i count = 0 else: d[s] = count m = 0 for key, val in d.items(): m = max(m, val) for key, val in d.items(): if val == m and key != "": print(key)