text = list(input())
text.sort()
word = {}
temp = []
for i in text:
    word[i] = text.count(i)

for k, v in word.items():
    temp.append((k, v))
temp.sort(key=lambda x: x[1], reverse=True)
for j in temp:
    print(j[0], end="")