(function(input) {
  'use strict';
  var s = ''
  input.split("\n").some(function(line) {
    for (var i = 0; i < line.length; i++) {
      s += line[i] == '1' ? '9' : '1'
    }
  })
  console.log(s)
})(require('fs').readFileSync('/dev/stdin', 'utf8'))
