#include <iostream>
#include <stdio.h>
#include <string.h>
#include <math.h>
#include <stdlib.h>
using namespace std;

int main() {
    char* s;
    s=new char[10];
    int n, k, m;
    while(1) {
        scanf("%s",s);
        if (!strcmp(s,"END")) return 0;
        n = atoi(s);
        m = 0;
        while(1)
        {
        k = n % 10;
        n = n / 10;
        if(k > 0)
        {
        k--;
        break;
        }
        m++;
        }
        n = 10*n+k;
        n = n*pow(10, m);
        cout<<n<<endl;
    }

    return 0;
}