#include <iostream>
#include <string>

using namespace std;

int main(void){

string line;
int i;
getline(cin, line);
while(line!="END"){
    bool is_minus=false;
    int sum=0;
    int i;
    for(i=line.length()-1; i>=0; i--)
        if((sum+=9-(line[i]-'0'))>1)
            break;
    i--;


    if(i<0){
        is_minus=true;
        for(i=line.length()-1; i>=0 && line[i]=='9'; i--);
        if(i<0)
            line='1'+line;
         else
            line[i]++;
        for(i=0; i<line.length() && line[i]=='0'; i++);
        if(i==line.length())
            i--;
        line=line.substr(i, line.length()-i);
    } else{


        while(line[i]=='0')
            i--;
        line[i]--;
        i++;
        sum=2;
        while((unsigned int)i<line.length() && sum){
            if(sum-- && line[i]!='9')
                line[i]++;
            if(sum-- && line[i]!='9')
                line[i]++;
            i++;
        }
        for(i=0; i<line.length() && line[i]=='0'; i++);
        if(i==line.length())
            i--;
        line=line.substr(i, line.length()-i);
    }


    if(is_minus)
        cout<<"-";
    cout<<line<<endl;
    getline(cin, line);
}

return 0;}