#include #include #include #include #include #include #include #include #include #include using namespace std; int main(){ int t, size, ind = 9; string s; vector v(10); cin >> s; size = s.size(); for (int i = 0; i < s.size(); i++){ t = s[i] - '0'; v[t]++; } s = ""; while (size){ while (!v[ind]) ind--; s += ind + '0'; v[ind]--; size--; } cout << s << endl; }