import java.util.Scanner;
public class Main {
    public static void main(String[] args){
        Scanner sc=new Scanner(System.in);
        String line=sc.nextLine();
        char[] num=new char[line.length()];
        for(int i=0;i<num.length;i++){
            if(line.charAt(i)=='1')
                num[i]='9';
            else if(line.charAt(i)=='9')
                num[i]='1';
            else
                num[i]=line.charAt(i);
            System.out.print(num[i]);
        }
        System.out.println();
    }
} import java.util.Scanner; Scanner java.util public class Main {
    public static void main(String[] args){
        Scanner sc=new Scanner(System.in);
        String line=sc.nextLine();
        char[] num=new char[line.length()];
        for(int i=0;i<num.length;i++){
            if(line.charAt(i)=='1')
                num[i]='9';
            else if(line.charAt(i)=='9')
                num[i]='1';
            else
                num[i]=line.charAt(i);
            System.out.print(num[i]);
        }
        System.out.println();
    }
} Main public static void main(String[] args){
        Scanner sc=new Scanner(System.in);
        String line=sc.nextLine();
        char[] num=new char[line.length()];
        for(int i=0;i<num.length;i++){
            if(line.charAt(i)=='1')
                num[i]='9';
            else if(line.charAt(i)=='9')
                num[i]='1';
            else
                num[i]=line.charAt(i);
            System.out.print(num[i]);
        }
        System.out.println();
    } main {
        Scanner sc=new Scanner(System.in);
        String line=sc.nextLine();
        char[] num=new char[line.length()];
        for(int i=0;i<num.length;i++){
            if(line.charAt(i)=='1')
                num[i]='9';
            else if(line.charAt(i)=='9')
                num[i]='1';
            else
                num[i]=line.charAt(i);
            System.out.print(num[i]);
        }
        System.out.println();
    } Scanner sc=new Scanner(System.in); sc new Scanner(System.in) String line=sc.nextLine(); line sc.nextLine() sc.nextLine sc char[] num=new char[line.length()]; num new char[line.length()] line.length() line.length line for(int i=0;i<num.length;i++){
            if(line.charAt(i)=='1')
                num[i]='9';
            else if(line.charAt(i)=='9')
                num[i]='1';
            else
                num[i]=line.charAt(i);
            System.out.print(num[i]);
        } int i=0; int i=0; i 0 i<num.length i num.length num num.length i++ i++ i {
            if(line.charAt(i)=='1')
                num[i]='9';
            else if(line.charAt(i)=='9')
                num[i]='1';
            else
                num[i]=line.charAt(i);
            System.out.print(num[i]);
        } {
            if(line.charAt(i)=='1')
                num[i]='9';
            else if(line.charAt(i)=='9')
                num[i]='1';
            else
                num[i]=line.charAt(i);
            System.out.print(num[i]);
        } if(line.charAt(i)=='1')
                num[i]='9';
            else if(line.charAt(i)=='9')
                num[i]='1';
            else
                num[i]=line.charAt(i); line.charAt(i)=='1' line.charAt(i) line.charAt line i '1' num[i]='9' num[i] num i '9' if(line.charAt(i)=='9')
                num[i]='1';
            else
                num[i]=line.charAt(i); line.charAt(i)=='9' line.charAt(i) line.charAt line i '9' num[i]='1' num[i] num i '1' num[i]=line.charAt(i) num[i] num i line.charAt(i) line.charAt line i System.out.print(num[i]) System.out.print System.out System System.out num[i] num i System.out.println() System.out.println System.out System System.out String[] args args public class Main {
    public static void main(String[] args){
        Scanner sc=new Scanner(System.in);
        String line=sc.nextLine();
        char[] num=new char[line.length()];
        for(int i=0;i<num.length;i++){
            if(line.charAt(i)=='1')
                num[i]='9';
            else if(line.charAt(i)=='9')
                num[i]='1';
            else
                num[i]=line.charAt(i);
            System.out.print(num[i]);
        }
        System.out.println();
    }
} public class Main {
    public static void main(String[] args){
        Scanner sc=new Scanner(System.in);
        String line=sc.nextLine();
        char[] num=new char[line.length()];
        for(int i=0;i<num.length;i++){
            if(line.charAt(i)=='1')
                num[i]='9';
            else if(line.charAt(i)=='9')
                num[i]='1';
            else
                num[i]=line.charAt(i);
            System.out.print(num[i]);
        }
        System.out.println();
    }
} Main
import java.util.Scanner;
public class Main {
    public static void main(String[] args){
        Scanner sc=new Scanner(System.in);
        String line=sc.nextLine();
        char[] num=new char[line.length()];
        for(int i=0;i<num.length;i++){
            if(line.charAt(i)=='1')
                num[i]='9';
            else if(line.charAt(i)=='9')
                num[i]='1';
            else
                num[i]=line.charAt(i);
            System.out.print(num[i]);
        }
        System.out.println();
    }
}
