#include #include #include #include using namespace std; int main(){ string str; cin >> str; vectorV; for (int i = 0; i < str.size(); i++){ for (int j = i + 1; j < str.size(); j++){ string to = str; swap(to[i], to[j]); V.push_back(to); } } V.push_back(str); sort(V.begin(), V.end()); cout << V.back() << endl; return 0; }