#include #include using namespace std; int main(){ string N; cin >> N; int K = N.size(); string ans = N; for (int i = 0; i < K; i++){ for (int j = i + 1; j < K; j++){ string N2 = N; swap(N2[i], N2[j]); ans = max(ans, N2); } } cout << ans << endl; }