import java.util.Scanner;

public class Main{

    public static void main(String[] args){


        Scanner scanNum = new Scanner(System.in);

        String inputNum = scanNum.next();

        scanNum.close();

        char[] charArray = inputNum.toCharArray();

        String print = "";

        for(int i=0; i < inputNum.length() ; i++){
            if(charArray[i] == '1'){
                charArray[i] = '9';
                print = print + 9;
            }
            else{
                charArray[i] = '1';
                print = print + 1;
            }
        }


        System.out.print(print);
    }
} import java.util.Scanner; Scanner java.util public class Main{

    public static void main(String[] args){


        Scanner scanNum = new Scanner(System.in);

        String inputNum = scanNum.next();

        scanNum.close();

        char[] charArray = inputNum.toCharArray();

        String print = "";

        for(int i=0; i < inputNum.length() ; i++){
            if(charArray[i] == '1'){
                charArray[i] = '9';
                print = print + 9;
            }
            else{
                charArray[i] = '1';
                print = print + 1;
            }
        }


        System.out.print(print);
    }
} Main public static void main(String[] args){


        Scanner scanNum = new Scanner(System.in);

        String inputNum = scanNum.next();

        scanNum.close();

        char[] charArray = inputNum.toCharArray();

        String print = "";

        for(int i=0; i < inputNum.length() ; i++){
            if(charArray[i] == '1'){
                charArray[i] = '9';
                print = print + 9;
            }
            else{
                charArray[i] = '1';
                print = print + 1;
            }
        }


        System.out.print(print);
    } main {


        Scanner scanNum = new Scanner(System.in);

        String inputNum = scanNum.next();

        scanNum.close();

        char[] charArray = inputNum.toCharArray();

        String print = "";

        for(int i=0; i < inputNum.length() ; i++){
            if(charArray[i] == '1'){
                charArray[i] = '9';
                print = print + 9;
            }
            else{
                charArray[i] = '1';
                print = print + 1;
            }
        }


        System.out.print(print);
    } Scanner scanNum = new Scanner(System.in); scanNum new Scanner(System.in) String inputNum = scanNum.next(); inputNum scanNum.next() scanNum.next scanNum scanNum.close() scanNum.close scanNum char[] charArray = inputNum.toCharArray(); charArray inputNum.toCharArray() inputNum.toCharArray inputNum String print = ""; print "" for(int i=0; i < inputNum.length() ; i++){
            if(charArray[i] == '1'){
                charArray[i] = '9';
                print = print + 9;
            }
            else{
                charArray[i] = '1';
                print = print + 1;
            }
        } int i=0; int i=0; i 0 i < inputNum.length() i inputNum.length() inputNum.length inputNum i++ i++ i {
            if(charArray[i] == '1'){
                charArray[i] = '9';
                print = print + 9;
            }
            else{
                charArray[i] = '1';
                print = print + 1;
            }
        } {
            if(charArray[i] == '1'){
                charArray[i] = '9';
                print = print + 9;
            }
            else{
                charArray[i] = '1';
                print = print + 1;
            }
        } if(charArray[i] == '1'){
                charArray[i] = '9';
                print = print + 9;
            }
            else{
                charArray[i] = '1';
                print = print + 1;
            } charArray[i] == '1' charArray[i] charArray i '1' {
                charArray[i] = '9';
                print = print + 9;
            } charArray[i] = '9' charArray[i] charArray i '9' print = print + 9 print print + 9 print 9 {
                charArray[i] = '1';
                print = print + 1;
            } charArray[i] = '1' charArray[i] charArray i '1' print = print + 1 print print + 1 print 1 System.out.print(print) System.out.print System.out System System.out print String[] args args public class Main{

    public static void main(String[] args){


        Scanner scanNum = new Scanner(System.in);

        String inputNum = scanNum.next();

        scanNum.close();

        char[] charArray = inputNum.toCharArray();

        String print = "";

        for(int i=0; i < inputNum.length() ; i++){
            if(charArray[i] == '1'){
                charArray[i] = '9';
                print = print + 9;
            }
            else{
                charArray[i] = '1';
                print = print + 1;
            }
        }


        System.out.print(print);
    }
} public class Main{

    public static void main(String[] args){


        Scanner scanNum = new Scanner(System.in);

        String inputNum = scanNum.next();

        scanNum.close();

        char[] charArray = inputNum.toCharArray();

        String print = "";

        for(int i=0; i < inputNum.length() ; i++){
            if(charArray[i] == '1'){
                charArray[i] = '9';
                print = print + 9;
            }
            else{
                charArray[i] = '1';
                print = print + 1;
            }
        }


        System.out.print(print);
    }
} Main
import java.util.Scanner;

public class Main{

    public static void main(String[] args){


        Scanner scanNum = new Scanner(System.in);

        String inputNum = scanNum.next();

        scanNum.close();

        char[] charArray = inputNum.toCharArray();

        String print = "";

        for(int i=0; i < inputNum.length() ; i++){
            if(charArray[i] == '1'){
                charArray[i] = '9';
                print = print + 9;
            }
            else{
                charArray[i] = '1';
                print = print + 1;
            }
        }


        System.out.print(print);
    }
}