#include using namespace std; //#define int long long #define FOR(i, j, k) for(int i = j; i < k; ++i) #define rep(i, j) FOR(i, 0, j) #define FORr(i, j, k) for(int i = j; i >= k; --i) #define repr(i, j) FORr(i, j, 0) #define INF (1 << 30) typedef unsigned long long ull; typedef pair P; typedef pair Pi; const int MOD = 1e9 + 7; const int dy[] = {0, 0, 1, -1}; const int dx[] = {1, -1, 0, 0}; template void chmin(T& a, const T& b) { a = min(a, b); } template void chmax(T& a, const T& b) { a = max(a, b); } signed main() { cin.tie(0); ios::sync_with_stdio(false); string s; cin >> s; rep(i, s.size()) { int cha = i; for(int j = s.size() - 1; j > i; --j) { if(s[cha] < s[j]) { cha = j; } } if(cha != i) { swap(s[i], s[cha]); cout << s << endl; return 0; } } cout << s << endl; return 0; }