    import java.util.Scanner;
    class Main{
        public static void main(String arg[]){
            Scanner scn=new Scanner(System.in);
            String n=scn.next();
            for(int i=0;i<n.length();i++){
                if(n.charAt(i)=='9'){
                    System.out.print('1');
                }else{
                    System.out.print('9');
                }
            }
            System.out.println();
        }
    } import java.util.Scanner; Scanner java.util class Main{
        public static void main(String arg[]){
            Scanner scn=new Scanner(System.in);
            String n=scn.next();
            for(int i=0;i<n.length();i++){
                if(n.charAt(i)=='9'){
                    System.out.print('1');
                }else{
                    System.out.print('9');
                }
            }
            System.out.println();
        }
    } Main public static void main(String arg[]){
            Scanner scn=new Scanner(System.in);
            String n=scn.next();
            for(int i=0;i<n.length();i++){
                if(n.charAt(i)=='9'){
                    System.out.print('1');
                }else{
                    System.out.print('9');
                }
            }
            System.out.println();
        } main {
            Scanner scn=new Scanner(System.in);
            String n=scn.next();
            for(int i=0;i<n.length();i++){
                if(n.charAt(i)=='9'){
                    System.out.print('1');
                }else{
                    System.out.print('9');
                }
            }
            System.out.println();
        } Scanner scn=new Scanner(System.in); scn new Scanner(System.in) String n=scn.next(); n scn.next() scn.next scn for(int i=0;i<n.length();i++){
                if(n.charAt(i)=='9'){
                    System.out.print('1');
                }else{
                    System.out.print('9');
                }
            } int i=0; int i=0; i 0 i<n.length() i n.length() n.length n i++ i++ i {
                if(n.charAt(i)=='9'){
                    System.out.print('1');
                }else{
                    System.out.print('9');
                }
            } {
                if(n.charAt(i)=='9'){
                    System.out.print('1');
                }else{
                    System.out.print('9');
                }
            } if(n.charAt(i)=='9'){
                    System.out.print('1');
                }else{
                    System.out.print('9');
                } n.charAt(i)=='9' n.charAt(i) n.charAt n i '9' {
                    System.out.print('1');
                } System.out.print('1') System.out.print System.out System System.out '1' {
                    System.out.print('9');
                } System.out.print('9') System.out.print System.out System System.out '9' System.out.println() System.out.println System.out System System.out String arg[] arg
    import java.util.Scanner;
    class Main{
        public static void main(String arg[]){
            Scanner scn=new Scanner(System.in);
            String n=scn.next();
            for(int i=0;i<n.length();i++){
                if(n.charAt(i)=='9'){
                    System.out.print('1');
                }else{
                    System.out.print('9');
                }
            }
            System.out.println();
        }
    }