import java.util.*;
import java.util.Scanner;

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

        int n = sc.nextInt();

        int[] digits = new int[3];

        for (int i = 2; i >= 0; i--) {
           digits[i] = n % 10;
           if (digits[i] == 1) {
               digits[i] = 9;
           } else {
               digits[i] = 1;
           }
           n = n / 10;
        }
        System.out.println(digits[0] + "" + digits[1] + "" + digits[2]);
    }
} import java.util.*; util.* java 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();

        int[] digits = new int[3];

        for (int i = 2; i >= 0; i--) {
           digits[i] = n % 10;
           if (digits[i] == 1) {
               digits[i] = 9;
           } else {
               digits[i] = 1;
           }
           n = n / 10;
        }
        System.out.println(digits[0] + "" + digits[1] + "" + digits[2]);
    }
} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        int n = sc.nextInt();

        int[] digits = new int[3];

        for (int i = 2; i >= 0; i--) {
           digits[i] = n % 10;
           if (digits[i] == 1) {
               digits[i] = 9;
           } else {
               digits[i] = 1;
           }
           n = n / 10;
        }
        System.out.println(digits[0] + "" + digits[1] + "" + digits[2]);
    } main {
        Scanner sc = new Scanner(System.in);

        int n = sc.nextInt();

        int[] digits = new int[3];

        for (int i = 2; i >= 0; i--) {
           digits[i] = n % 10;
           if (digits[i] == 1) {
               digits[i] = 9;
           } else {
               digits[i] = 1;
           }
           n = n / 10;
        }
        System.out.println(digits[0] + "" + digits[1] + "" + digits[2]);
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc int[] digits = new int[3]; digits new int[3] 3 for (int i = 2; i >= 0; i--) {
           digits[i] = n % 10;
           if (digits[i] == 1) {
               digits[i] = 9;
           } else {
               digits[i] = 1;
           }
           n = n / 10;
        } int i = 2; int i = 2; i 2 i >= 0 i 0 i-- i-- i {
           digits[i] = n % 10;
           if (digits[i] == 1) {
               digits[i] = 9;
           } else {
               digits[i] = 1;
           }
           n = n / 10;
        } {
           digits[i] = n % 10;
           if (digits[i] == 1) {
               digits[i] = 9;
           } else {
               digits[i] = 1;
           }
           n = n / 10;
        } digits[i] = n % 10 digits[i] digits i n % 10 n 10 if (digits[i] == 1) {
               digits[i] = 9;
           } else {
               digits[i] = 1;
           } digits[i] == 1 digits[i] digits i 1 {
               digits[i] = 9;
           } digits[i] = 9 digits[i] digits i 9 {
               digits[i] = 1;
           } digits[i] = 1 digits[i] digits i 1 n = n / 10 n n / 10 n 10 System.out.println(digits[0] + "" + digits[1] + "" + digits[2]) System.out.println System.out System System.out digits[0] + "" + digits[1] + "" + digits[2] "" digits[1] digits[0] + "" + digits[1] + "" + digits[2] digits[0] digits 0 "" digits[1] digits 1 "" digits[2] digits 2 String[] args args public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        int n = sc.nextInt();

        int[] digits = new int[3];

        for (int i = 2; i >= 0; i--) {
           digits[i] = n % 10;
           if (digits[i] == 1) {
               digits[i] = 9;
           } else {
               digits[i] = 1;
           }
           n = n / 10;
        }
        System.out.println(digits[0] + "" + digits[1] + "" + digits[2]);
    }
} public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        int n = sc.nextInt();

        int[] digits = new int[3];

        for (int i = 2; i >= 0; i--) {
           digits[i] = n % 10;
           if (digits[i] == 1) {
               digits[i] = 9;
           } else {
               digits[i] = 1;
           }
           n = n / 10;
        }
        System.out.println(digits[0] + "" + digits[1] + "" + digits[2]);
    }
} Main
import java.util.*;
import java.util.Scanner;

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

        int n = sc.nextInt();

        int[] digits = new int[3];

        for (int i = 2; i >= 0; i--) {
           digits[i] = n % 10;
           if (digits[i] == 1) {
               digits[i] = 9;
           } else {
               digits[i] = 1;
           }
           n = n / 10;
        }
        System.out.println(digits[0] + "" + digits[1] + "" + digits[2]);
    }
}