import java.util.Scanner;

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

            int[] a = new int[3];
            a[0] = n / 100;
            a[1] = n % 100;
            a[2] = a[1] % 10;
            a[1] = a[1] /10;

            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(a[0] * 100 + a[1] * 10 + a[2]);
        }
    }
} import java.util.Scanner; Scanner java.util public class Main{
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        while(in.hasNext()){
            int n = in.nextInt();

            int[] a = new int[3];
            a[0] = n / 100;
            a[1] = n % 100;
            a[2] = a[1] % 10;
            a[1] = a[1] /10;

            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(a[0] * 100 + a[1] * 10 + a[2]);
        }
    }
} Main public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        while(in.hasNext()){
            int n = in.nextInt();

            int[] a = new int[3];
            a[0] = n / 100;
            a[1] = n % 100;
            a[2] = a[1] % 10;
            a[1] = a[1] /10;

            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(a[0] * 100 + a[1] * 10 + a[2]);
        }
    } main {
        Scanner in = new Scanner(System.in);
        while(in.hasNext()){
            int n = in.nextInt();

            int[] a = new int[3];
            a[0] = n / 100;
            a[1] = n % 100;
            a[2] = a[1] % 10;
            a[1] = a[1] /10;

            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(a[0] * 100 + a[1] * 10 + a[2]);
        }
    } Scanner in = new Scanner(System.in); in new Scanner(System.in) while(in.hasNext()){
            int n = in.nextInt();

            int[] a = new int[3];
            a[0] = n / 100;
            a[1] = n % 100;
            a[2] = a[1] % 10;
            a[1] = a[1] /10;

            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(a[0] * 100 + a[1] * 10 + a[2]);
        } in.hasNext() in.hasNext in {
            int n = in.nextInt();

            int[] a = new int[3];
            a[0] = n / 100;
            a[1] = n % 100;
            a[2] = a[1] % 10;
            a[1] = a[1] /10;

            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(a[0] * 100 + a[1] * 10 + a[2]);
        } int n = in.nextInt(); n in.nextInt() in.nextInt in int[] a = new int[3]; a new int[3] 3 a[0] = n / 100 a[0] a 0 n / 100 n 100 a[1] = n % 100 a[1] a 1 n % 100 n 100 a[2] = a[1] % 10 a[2] a 2 a[1] % 10 a[1] a 1 10 a[1] = a[1] /10 a[1] a 1 a[1] /10 a[1] a 1 10 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] = 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] = 1 a[i] a i 1 System.out.println(a[0] * 100 + a[1] * 10 + a[2]) System.out.println System.out System System.out a[0] * 100 + a[1] * 10 + a[2] a[0] * 100 + a[1] * 10 + a[2] a[0] * 100 a[0] a 0 100 a[1] * 10 a[1] a 1 10 a[2] a 2 String[] args args public class Main{
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        while(in.hasNext()){
            int n = in.nextInt();

            int[] a = new int[3];
            a[0] = n / 100;
            a[1] = n % 100;
            a[2] = a[1] % 10;
            a[1] = a[1] /10;

            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(a[0] * 100 + a[1] * 10 + a[2]);
        }
    }
} public class Main{
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        while(in.hasNext()){
            int n = in.nextInt();

            int[] a = new int[3];
            a[0] = n / 100;
            a[1] = n % 100;
            a[2] = a[1] % 10;
            a[1] = a[1] /10;

            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(a[0] * 100 + a[1] * 10 + a[2]);
        }
    }
} Main
import java.util.Scanner;

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

            int[] a = new int[3];
            a[0] = n / 100;
            a[1] = n % 100;
            a[2] = a[1] % 10;
            a[1] = a[1] /10;

            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(a[0] * 100 + a[1] * 10 + a[2]);
        }
    }
}