#include #include using namespace std; int main() { char s[10]; cin >> s; for ( char* pl = s; *pl != '\0'; pl++ ) { char* pr = pl; for ( char* p = pl + 1; *p != '\0'; p++ ) { if ( *p >= *pr ) { pr = p; } } if ( pr != pl ) { swap(*pl, *pr); break; } } cout << s << endl; return 0; }