#include <iostream>
#include <algorithm>
#include <functional>
#include <string>
#include <cctype>

using namespace std;

int main() {
        string input;
        char result[11] {};
        int front {0};
        int back {9};
        bool number_exists {false};

        cin >> input;

        for_each(begin(input), begin(input) + 10,
                        [&](char c) {
                                if(isdigit(c)) {
                                        if( not number_exists and c != '0' ) {
                                                number_exists = true;
                                        }
                                        result[front++] = c;
                                } else if(islower(c)) {
                                        result[back--] = c;
                                }
                        });

        if( not number_exists or back == 9 ) {
                cout << "error!!" << endl;
                return 1;
        }

        sort(begin(result), begin(result) + front, greater<char>());
        sort(begin(result) + front, end(result) - 1, less<char>());

        cout << result << endl;
        return 0;
}
