'use strict';

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

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