import java.util.*;
public class Main {
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        char[] originalChrs = scan.nextLine().toCharArray();
        HashSet<Character> hashSet = new HashSet<>();
        HashMap<Character, Integer> everyCharOccurrences = new HashMap<>();
        for (char currentChr : originalChrs) {
            hashSet.add(currentChr);
            int occurrences = everyCharOccurrences.getOrDefault(currentChr, 0) + 1;
            everyCharOccurrences.put(currentChr, occurrences);
        }
        char[] ans = new char[hashSet.size()];
        int index = 0;
        for (char tmpChr : hashSet) {
            ans[index++] = tmpChr;
        }
        mergeSort(ans, everyCharOccurrences);
        StringBuffer sb = new StringBuffer("");
        for (char tmpChr : ans) {
            sb.append(tmpChr);
        }
        System.out.println(sb);
    }
    public static void mergeSort(char[] chrs, HashMap<Character, Integer> nums) {
        if (null == chrs || chrs.length < 2) {
            return;
        }
        process(chrs, 0, chrs.length - 1, nums);
    }
    public static void process(char[] chrs, int start, int end, HashMap<Character, Integer> nums) {
        if (start >= end) {
            return;
        }
        int mid = start + ((end - start) >> 1);
        process(chrs, start, mid, nums);
        process(chrs, mid + 1, end, nums);
        merge(chrs, start, mid, end, nums);
    }
    public static void merge(char[] chrs, int start, int mid, int end, HashMap<Character, Integer> nums) {
        char[] helper = new char[end - start + 1];
        int index = 0;
        int p1 = start;
        int p2 = mid + 1;
        while (p1 <= mid && p2 <= end) {
            if (nums.get(chrs[p1]) > nums.get(chrs[p2])) {
                helper[index++] = chrs[p1++];
            } else if (nums.get(chrs[p1]) < nums.get(chrs[p2])) {
                helper[index++] = chrs[p2++];
            } else {
                helper[index++] = chrs[p1] <= chrs[p2] ? chrs[p1++] : chrs[p2++];
            }
        }
        while (p1 <= mid) {
            helper[index++] = chrs[p1++];
        }
        while (p2 <= end) {
            helper[index++] = chrs[p2++];
        }
        for (int i = 0; i < helper.length; i++) {
            chrs[start + i] = helper[i];
        }
    }
}