#include <iostream>
#include <string> 
using namespace std;

string sucet2 (string& st)
{
  int toAdd = 2;
  int remove = 1;
  
  if(st[0] != '-'){
    for( int i = st.size()-1; i >= -1; i--){
      if(i == -1){
	if(toAdd == 2 && remove == 1){
	  st.insert(0, 1, '1');
	  st.insert(0 ,1 , '-');
	}
	else if(toAdd == 1 && remove == 1){
	  st = st.insert(0 ,1 , '-');
	}
        else if(remove == 1 && toAdd == 0){
	  st = st.insert(0 ,1 , '-');
	  st[1]--;
	 
	}
        break;
      }

      if(st[i] == '0' && i-1 >= 0 && st[i-1] == '0'){
	continue;
      }

      if(st[i] == '9'){
	if (toAdd)
	  continue;
	else {
	  st[i]--;
	  break;
	}
      }

      if(st[i] == '8'){
	if (toAdd){
	  st[i]++;
	  toAdd--;
	  continue;
	}
	else{
	  st[i]--;
	  break;
	}
      }

      if(toAdd){
	st[i] += toAdd;
	toAdd = 0;
	continue;
      }
      else{
	if(st[i] == '0'){
	  continue;
	}
	st[i]--;
	break;
      }

    }

  }
  else{
    for( int i = st.size()-1; i >= 0; i--){
      if(i == 0){
	st.insert(1, 1, '1');
        break;
      }

      if(st[i] == '9'){
	  continue;
      }
	else {
	  st[i]++;
	  break;
	}
      }

    }

  while (st[0]=='0')
    st.erase(0,1);

  return st;
}

int main ()
{
  std::ios_base::sync_with_stdio(false);
  string input;
  while ( cin >> input)
    {
      if (input == "END" )
	return 0;
      cout << sucet2(input) << endl;
      
    }
  return 0;
}