#include "bits/stdc++.h" using namespace std; int main() { string cs; cin >> cs; int N = cs.size(); for (int i = 0; i < N; i++) { int max = cs[i]; int pos = i; for (int j = N - 1; j >= i + 1; j--) { if (max < cs[j]){ max = cs[j]; pos = j; } } if (pos != i){ swap(cs[i], cs[pos]); break; } } cout << cs << endl; }