#include #include using namespace std; string S; int main() { cin >> S; string res = S; for (int i = 0; i < S.length(); i++) { for (int j = i + 1; j < S.length(); j++) { char tmp = S[i]; S[i] = S[j]; S[j] = tmp; if (S > res) { res = S; } tmp = S[i]; S[i] = S[j]; S[j] = tmp; } } cout << res << endl; return 0; }