#include using namespace std; int main() { string s; cin >> s; int ma = 0; for (int i = 0; i < s.size(); ++i) { for (int j = 0; j < i; ++j) { swap(s[i], s[j]); ma = max(ma, stoi(s)); swap(s[i], s[j]); } } cout << ma << endl; }