#include #include #include using namespace std; using ll = long long; int main(void){ string s; cin >> s; int n=s.size(); vector ans(2); int r=-1; for(int i=0; i=0; i--){ if(ok||s[i]=='4') pre+=s[i]; else{ pre+='4'; ok=true; } } for(int i=r+1; i'5'){ aft+='5'; ok=true; } else{ aft+=s[i]; } } } cout << pre+aft << endl; return 0; }