#include using namespace std; signed main(){ string S; cin >> S; string ans = S; for( int i = 0; i < S.size(); ++i ) for( int j = i + 1; j < S.size(); ++j ){ string t = S; swap( t[ i ], t[ j ] ); if( ans < t ) ans = t; } cout << ans << endl; return 0; }