import java.util.Scanner;

public class Main{
    public static void main(String[] args) {
        
        Scanner sc = new Scanner(System.in);
        
        char[] input_text = sc.nextLine().toCharArray();
        
        for (int i = 0; i < input_text.length; i++) {
            switch (input_text[i]){
                case '1':
                    input_text[i] = '9';
                    break;
                case '9':
                    input_text[i] = '1';
                    break;
            }
        }
        
        String output_text = new String(input_text);
        System.out.println(output_text);
    }
} import java.util.Scanner; Scanner java.util public class Main{
    public static void main(String[] args) {
        
        Scanner sc = new Scanner(System.in);
        
        char[] input_text = sc.nextLine().toCharArray();
        
        for (int i = 0; i < input_text.length; i++) {
            switch (input_text[i]){
                case '1':
                    input_text[i] = '9';
                    break;
                case '9':
                    input_text[i] = '1';
                    break;
            }
        }
        
        String output_text = new String(input_text);
        System.out.println(output_text);
    }
} Main public static void main(String[] args) {
        
        Scanner sc = new Scanner(System.in);
        
        char[] input_text = sc.nextLine().toCharArray();
        
        for (int i = 0; i < input_text.length; i++) {
            switch (input_text[i]){
                case '1':
                    input_text[i] = '9';
                    break;
                case '9':
                    input_text[i] = '1';
                    break;
            }
        }
        
        String output_text = new String(input_text);
        System.out.println(output_text);
    } main {
        
        Scanner sc = new Scanner(System.in);
        
        char[] input_text = sc.nextLine().toCharArray();
        
        for (int i = 0; i < input_text.length; i++) {
            switch (input_text[i]){
                case '1':
                    input_text[i] = '9';
                    break;
                case '9':
                    input_text[i] = '1';
                    break;
            }
        }
        
        String output_text = new String(input_text);
        System.out.println(output_text);
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) char[] input_text = sc.nextLine().toCharArray(); input_text sc.nextLine().toCharArray() sc.nextLine().toCharArray sc.nextLine() sc.nextLine sc for (int i = 0; i < input_text.length; i++) {
            switch (input_text[i]){
                case '1':
                    input_text[i] = '9';
                    break;
                case '9':
                    input_text[i] = '1';
                    break;
            }
        } int i = 0; int i = 0; i 0 i < input_text.length i input_text.length input_text input_text.length i++ i++ i {
            switch (input_text[i]){
                case '1':
                    input_text[i] = '9';
                    break;
                case '9':
                    input_text[i] = '1';
                    break;
            }
        } {
            switch (input_text[i]){
                case '1':
                    input_text[i] = '9';
                    break;
                case '9':
                    input_text[i] = '1';
                    break;
            }
        } switch (input_text[i]){
                case '1':
                    input_text[i] = '9';
                    break;
                case '9':
                    input_text[i] = '1';
                    break;
            } input_text[i] input_text i case '1': '1' case '1': input_text[i] = '9' input_text[i] input_text i '9' break; case '9': '9' case '9': input_text[i] = '1' input_text[i] input_text i '1' break; String output_text = new String(input_text); output_text new String(input_text) System.out.println(output_text) System.out.println System.out System System.out output_text String[] args args public class Main{
    public static void main(String[] args) {
        
        Scanner sc = new Scanner(System.in);
        
        char[] input_text = sc.nextLine().toCharArray();
        
        for (int i = 0; i < input_text.length; i++) {
            switch (input_text[i]){
                case '1':
                    input_text[i] = '9';
                    break;
                case '9':
                    input_text[i] = '1';
                    break;
            }
        }
        
        String output_text = new String(input_text);
        System.out.println(output_text);
    }
} public class Main{
    public static void main(String[] args) {
        
        Scanner sc = new Scanner(System.in);
        
        char[] input_text = sc.nextLine().toCharArray();
        
        for (int i = 0; i < input_text.length; i++) {
            switch (input_text[i]){
                case '1':
                    input_text[i] = '9';
                    break;
                case '9':
                    input_text[i] = '1';
                    break;
            }
        }
        
        String output_text = new String(input_text);
        System.out.println(output_text);
    }
} Main
import java.util.Scanner;

public class Main{
    public static void main(String[] args) {
        
        Scanner sc = new Scanner(System.in);
        
        char[] input_text = sc.nextLine().toCharArray();
        
        for (int i = 0; i < input_text.length; i++) {
            switch (input_text[i]){
                case '1':
                    input_text[i] = '9';
                    break;
                case '9':
                    input_text[i] = '1';
                    break;
            }
        }
        
        String output_text = new String(input_text);
        System.out.println(output_text);
    }
}
