#include using namespace std; // #define int long long using ll=long long; using vi=vector; using vl=vector; using pii=pair; #define ITR(v,c) for(auto v=begin(c);v!=end(c);v++) #define FOR(v,a,n) for(int v=a;v<(int)(n);v++) #define FORE(x,arr) for(auto &x:arr) #define REP(v,n) FOR(v,0,n) #define RREP(v,n) for(int v=((int)(n)-1);v>=0;v--) #define ALL(c) begin(c),end(c) #define RALL(c) rbegin(c),rend(c) #define SZ(c) ((int)c.size()) #define DUMP(x) cerr<<#x<<":="<<(x)<ostream&operator<<(ostream &os,const pair &p){ os<<"("<ostream&operator<<(ostream &os,const vector &v){ ITR(i,v)os<<*i<<(i==end(v)-1?"":" ");return os;} //------------------------------------------------------------------------------ signed main() { string n; cin>>n; string s=""; REP(i,SZ(n)) { FOR(j,i,SZ(n)) { string t=n; swap(t[i],t[j]); s=max(s,t); } } cout<