#include #include #include using namespace std; int main(){ string str; cin >> str; int maxi = stoi(str); for(int i = 0 ; i < str.size() ; ++i){ for(int j = i+1 ; j < str.size() ; ++j){ char temp; temp = str[j]; string t = str; t[j] = t[i]; t[i] = temp; maxi = max(stoi(t) , maxi); } } cout << maxi << endl; }