
function main(input){
    d=input.split('');
    process.stdout.write(10-d[0])
    process.stdout.write(10-d[1])
    process.stdout.write(10-d[2])
    console.log()


}

main(require('fs').readFileSync('/dev/stdin', 'utf8'));