
(function(input) {
  'use strict';
  input.split("\n").some(function(line) {
    const stringOfN = line.toString()
    const ArrayOfN = stringOfN.split("")
    let res = ArrayOfN.map(function(char){
      if (char === '1' ) return '9'
      if (char === '9' ) return '1'
    }).toString()
    res = res.replace(/,/gi, "")
    console.log(res);
  })
})(require('fs').readFileSync('/dev/stdin', 'utf8'))