#include <iostream>
#include <cstring>
using namespace std;

const int TEN = 10;

bool isDigit(char c) {
    return '0' <= c && c <= '9';
}

void countDigits(int fr[], char text[]) {
    int textLen = strlen(text);
    for (int i = 0; i < textLen; ++i) {
        if (isDigit(text[i])) {
            ++fr[text[i] - '0'];
        }
    }
}

int constructNum(int fr[]) {
    int biggerNum = 0;
    for (int i = TEN - 1; i >= 0; --i) {
        for (int j = 1; j <= fr[i]; ++j) {
            biggerNum = biggerNum * TEN + i;
        }
    }
    return biggerNum;
}

int biggerNumber(char text[]) {
    int fr[TEN] = {0};
    countDigits(fr, text);
    return constructNum(fr);
}

int main() {
    char text[100];
    cin >> text;
    cout << biggerNumber(text);
    return 0;
}