#include using namespace std; string s; int main() { cin >> s; for(int i = 9; i > s[0] - 48; i--) { bool ok = false; for(int j = 1; j < s.size(); j++) { if(s[j] - 48 == i) { swap(s[0], s[j]); ok = true; break; } } if(ok) break; } cout << s << endl; return 0; }