#include using namespace std; typedef unsigned long long ul; typedef signed long long ll; ul over = 1000000007; int main(void) { cin.tie(0); ios::sync_with_stdio(false); cout << fixed; string n; cin >> n; string ans = n; for (int i = 0; i < n.size(); ++i) { for (int j = i+1; j < n.size(); ++j) { string ns = n; ns[i] = n[j]; ns[j] = n[i]; ans = max(ans, ns); } } cout << ans << endl; return 0; }