#include "bits/stdc++.h" using namespace std; int main() { char cs[20]; cin >> cs; int N = strlen(cs); 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; }