import std.stdio;
import std.conv;
import std.array;


string solve(int n, char[] ans = []) {
    int s = 0;
    while (n || s) {
        n += s; s = 0;
        int x = n % 100;
        int l = (x % 10 ? 10 - x % 10 : 0);
        int u = x / 10 + (l == 0 ? 0 : 1);
        while (u >= 10) {
            s++;
            u -= 10;
        }
        ans ~= l + '0';
        ans ~= u + '0';
        n /= 100;
    }
    return cast(string)ans.reverse;
}

string solvePlus(int n) {
    return solve(n / 10, [n % 10 + '0']);
}

string solveMinus(int n) {
    return solve(-n);
}

void main() {
    int n;
    while (readf("%d\n", &n), n) {
        if (n >= 0) {
            solvePlus(n).writeln;
        } else {
            solveMinus(n).writeln;
        }
    }
}