#include using namespace std; using ll = long long; int main(){ string s; cin >> s; int a = s[0]-'0'; int mx = a; for(int i = 1; i < s.size(); i++){ mx = max(mx, s[i]-'0'); } int at = 0; for(int i = 1; i < s.size(); i++){ if(s[i]-'0'==mx) at = i; } swap(s[0], s[at]); cout << s << endl; return 0; }