fun main(args: Array<String>){
    val input = readLine()!!.map { it.toString().toInt() }.toTypedArray()
    val result = D0929A(input).judge()
    println(result)
}

class D0929A(
    val ints: Array<Int>
){
    fun judge(): String{
        return ints.map { 10 - it }
                   .joinToString("")
    }
}