import java.util.Scanner;

public class Main{
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();

        String N2 = String.valueOf(N);
        String result = "";

        for(int i = 0; i<N2.length(); i++){
            String temp = N2.substring(i,i+1);
            if(temp.equals("9")) {
                temp = "1";
            }else{
                temp = "9";
            }

            result += temp;
        }
        System.out.print(result);
    }
} import java.util.Scanner; Scanner java.util public class Main{
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();

        String N2 = String.valueOf(N);
        String result = "";

        for(int i = 0; i<N2.length(); i++){
            String temp = N2.substring(i,i+1);
            if(temp.equals("9")) {
                temp = "1";
            }else{
                temp = "9";
            }

            result += temp;
        }
        System.out.print(result);
    }
} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();

        String N2 = String.valueOf(N);
        String result = "";

        for(int i = 0; i<N2.length(); i++){
            String temp = N2.substring(i,i+1);
            if(temp.equals("9")) {
                temp = "1";
            }else{
                temp = "9";
            }

            result += temp;
        }
        System.out.print(result);
    } main {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();

        String N2 = String.valueOf(N);
        String result = "";

        for(int i = 0; i<N2.length(); i++){
            String temp = N2.substring(i,i+1);
            if(temp.equals("9")) {
                temp = "1";
            }else{
                temp = "9";
            }

            result += temp;
        }
        System.out.print(result);
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int N = sc.nextInt(); N sc.nextInt() sc.nextInt sc String N2 = String.valueOf(N); N2 String.valueOf(N) String.valueOf String N String result = ""; result "" for(int i = 0; i<N2.length(); i++){
            String temp = N2.substring(i,i+1);
            if(temp.equals("9")) {
                temp = "1";
            }else{
                temp = "9";
            }

            result += temp;
        } int i = 0; int i = 0; i 0 i<N2.length() i N2.length() N2.length N2 i++ i++ i {
            String temp = N2.substring(i,i+1);
            if(temp.equals("9")) {
                temp = "1";
            }else{
                temp = "9";
            }

            result += temp;
        } {
            String temp = N2.substring(i,i+1);
            if(temp.equals("9")) {
                temp = "1";
            }else{
                temp = "9";
            }

            result += temp;
        } String temp = N2.substring(i,i+1); temp N2.substring(i,i+1) N2.substring N2 i i+1 i 1 if(temp.equals("9")) {
                temp = "1";
            }else{
                temp = "9";
            } temp.equals("9") temp.equals temp "9" {
                temp = "1";
            } temp = "1" temp "1" {
                temp = "9";
            } temp = "9" temp "9" result += temp result temp System.out.print(result) System.out.print System.out System System.out result String[] args args public class Main{
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();

        String N2 = String.valueOf(N);
        String result = "";

        for(int i = 0; i<N2.length(); i++){
            String temp = N2.substring(i,i+1);
            if(temp.equals("9")) {
                temp = "1";
            }else{
                temp = "9";
            }

            result += temp;
        }
        System.out.print(result);
    }
} public class Main{
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();

        String N2 = String.valueOf(N);
        String result = "";

        for(int i = 0; i<N2.length(); i++){
            String temp = N2.substring(i,i+1);
            if(temp.equals("9")) {
                temp = "1";
            }else{
                temp = "9";
            }

            result += temp;
        }
        System.out.print(result);
    }
} Main
import java.util.Scanner;

public class Main{
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();

        String N2 = String.valueOf(N);
        String result = "";

        for(int i = 0; i<N2.length(); i++){
            String temp = N2.substring(i,i+1);
            if(temp.equals("9")) {
                temp = "1";
            }else{
                temp = "9";
            }

            result += temp;
        }
        System.out.print(result);
    }
}
