#include using namespace std; typedef long long int ll; int main() { cin.tie(0); ios::sync_with_stdio(false); string s; cin >> s; int t = s[0]-'0', pos = 0; for (int i = 1; i < s.size(); i++) { if (s[i]-'0' >= t) { t = s[i] -'0'; pos = i; } } swap(s[0], s[pos]); cout << s << endl; return 0; }