import java.util.Scanner;

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

        String n = sc.nextLine();
        String str[] = new String[3];
        str = n.split("");
        int a[] = new int[3];
        for (int i = 0; i < 3; i++)
            a[i] = Integer.parseInt(str[i]);
        for (int i = 0; i < 3; i++) {
            if (a[i] == 1)
                a[i] = 9;
            else if (a[i] == 9)
                a[i] = 1;
        }
        System.out.println(String.valueOf(a[0]) + String.valueOf(a[1]) + String.valueOf(a[2]));
    }
} import java.util.Scanner; Scanner java.util public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        String n = sc.nextLine();
        String str[] = new String[3];
        str = n.split("");
        int a[] = new int[3];
        for (int i = 0; i < 3; i++)
            a[i] = Integer.parseInt(str[i]);
        for (int i = 0; i < 3; i++) {
            if (a[i] == 1)
                a[i] = 9;
            else if (a[i] == 9)
                a[i] = 1;
        }
        System.out.println(String.valueOf(a[0]) + String.valueOf(a[1]) + String.valueOf(a[2]));
    }
} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        String n = sc.nextLine();
        String str[] = new String[3];
        str = n.split("");
        int a[] = new int[3];
        for (int i = 0; i < 3; i++)
            a[i] = Integer.parseInt(str[i]);
        for (int i = 0; i < 3; i++) {
            if (a[i] == 1)
                a[i] = 9;
            else if (a[i] == 9)
                a[i] = 1;
        }
        System.out.println(String.valueOf(a[0]) + String.valueOf(a[1]) + String.valueOf(a[2]));
    } main {
        Scanner sc = new Scanner(System.in);

        String n = sc.nextLine();
        String str[] = new String[3];
        str = n.split("");
        int a[] = new int[3];
        for (int i = 0; i < 3; i++)
            a[i] = Integer.parseInt(str[i]);
        for (int i = 0; i < 3; i++) {
            if (a[i] == 1)
                a[i] = 9;
            else if (a[i] == 9)
                a[i] = 1;
        }
        System.out.println(String.valueOf(a[0]) + String.valueOf(a[1]) + String.valueOf(a[2]));
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String n = sc.nextLine(); n sc.nextLine() sc.nextLine sc String str[] = new String[3]; str new String[3] 3 str = n.split("") str n.split("") n.split n "" int a[] = new int[3]; a new int[3] 3 for (int i = 0; i < 3; i++)
            a[i] = Integer.parseInt(str[i]); int i = 0; int i = 0; i 0 i < 3 i 3 i++ i++ i a[i] = Integer.parseInt(str[i]); a[i] = Integer.parseInt(str[i]) a[i] a i Integer.parseInt(str[i]) Integer.parseInt Integer str[i] str i for (int i = 0; i < 3; i++) {
            if (a[i] == 1)
                a[i] = 9;
            else if (a[i] == 9)
                a[i] = 1;
        } int i = 0; int i = 0; i 0 i < 3 i 3 i++ i++ i {
            if (a[i] == 1)
                a[i] = 9;
            else if (a[i] == 9)
                a[i] = 1;
        } {
            if (a[i] == 1)
                a[i] = 9;
            else if (a[i] == 9)
                a[i] = 1;
        } if (a[i] == 1)
                a[i] = 9;
            else if (a[i] == 9)
                a[i] = 1; a[i] == 1 a[i] a i 1 a[i] = 9 a[i] a i 9 if (a[i] == 9)
                a[i] = 1; a[i] == 9 a[i] a i 9 a[i] = 1 a[i] a i 1 System.out.println(String.valueOf(a[0]) + String.valueOf(a[1]) + String.valueOf(a[2])) System.out.println System.out System System.out String.valueOf(a[0]) + String.valueOf(a[1]) + String.valueOf(a[2]) String.valueOf(a[0]) + String.valueOf(a[1]) + String.valueOf(a[2]) String.valueOf(a[0]) String.valueOf String a[0] a 0 String.valueOf(a[1]) String.valueOf String a[1] a 1 String.valueOf(a[2]) String.valueOf String a[2] a 2 String[] args args public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        String n = sc.nextLine();
        String str[] = new String[3];
        str = n.split("");
        int a[] = new int[3];
        for (int i = 0; i < 3; i++)
            a[i] = Integer.parseInt(str[i]);
        for (int i = 0; i < 3; i++) {
            if (a[i] == 1)
                a[i] = 9;
            else if (a[i] == 9)
                a[i] = 1;
        }
        System.out.println(String.valueOf(a[0]) + String.valueOf(a[1]) + String.valueOf(a[2]));
    }
} public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        String n = sc.nextLine();
        String str[] = new String[3];
        str = n.split("");
        int a[] = new int[3];
        for (int i = 0; i < 3; i++)
            a[i] = Integer.parseInt(str[i]);
        for (int i = 0; i < 3; i++) {
            if (a[i] == 1)
                a[i] = 9;
            else if (a[i] == 9)
                a[i] = 1;
        }
        System.out.println(String.valueOf(a[0]) + String.valueOf(a[1]) + String.valueOf(a[2]));
    }
} Main
import java.util.Scanner;

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

        String n = sc.nextLine();
        String str[] = new String[3];
        str = n.split("");
        int a[] = new int[3];
        for (int i = 0; i < 3; i++)
            a[i] = Integer.parseInt(str[i]);
        for (int i = 0; i < 3; i++) {
            if (a[i] == 1)
                a[i] = 9;
            else if (a[i] == 9)
                a[i] = 1;
        }
        System.out.println(String.valueOf(a[0]) + String.valueOf(a[1]) + String.valueOf(a[2]));
    }
}
