'use strict';

function Main(INPUT) {
    const input = INPUT.split("");
    let out = "";
    for (let i = 0; i < input.length; i++) {
        out += input[i] == "1" ? "9" : "1";
    }
    console.log(out);
}

Main(require("fs").readFileSync("/dev/stdin", "utf8"));
