#include #include #define fastIO (cin.tie(0), cout.tie(0), ios::sync_with_stdio(false)) using namespace std; int main() { fastIO; string src; cin >> src; int ans = stoi(src); for (size_t i = 0; i < src.size() - 1; ++i) { for (size_t j = i + 1; j < src.size(); ++j) { string copy = src; swap(copy[i], copy[j]); ans = max(ans, stoi(copy)); } } cout << ans << '\n'; return 0; }