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