function main(input) {
  var tmp = toString(input);
  for(i=0;i<input.length;i++){
    if(tmp[i] == 9){
      tmp[i] = 1;
    }else{
      tmp[i] = 9;
    }
  }
  console.log(tmp);
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));
