import java.util.List;
import java.util.Scanner;
import java.util.ArrayList;
import java.util.Arrays;

public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        char[] input = sc.next().toCharArray();
        for (int i = 0; i < input.length; i++) {
            if (input[i] == '1')
                System.out.print('9');
            else
                System.out.print('1');
        }
        System.out.println("");
        
    }
} import java.util.List; List java.util import java.util.Scanner; Scanner java.util import java.util.ArrayList; ArrayList java.util import java.util.Arrays; Arrays java.util public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        char[] input = sc.next().toCharArray();
        for (int i = 0; i < input.length; i++) {
            if (input[i] == '1')
                System.out.print('9');
            else
                System.out.print('1');
        }
        System.out.println("");
        
    }
} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        char[] input = sc.next().toCharArray();
        for (int i = 0; i < input.length; i++) {
            if (input[i] == '1')
                System.out.print('9');
            else
                System.out.print('1');
        }
        System.out.println("");
        
    } main {
        Scanner sc = new Scanner(System.in);
        char[] input = sc.next().toCharArray();
        for (int i = 0; i < input.length; i++) {
            if (input[i] == '1')
                System.out.print('9');
            else
                System.out.print('1');
        }
        System.out.println("");
        
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) char[] input = sc.next().toCharArray(); input sc.next().toCharArray() sc.next().toCharArray sc.next() sc.next sc for (int i = 0; i < input.length; i++) {
            if (input[i] == '1')
                System.out.print('9');
            else
                System.out.print('1');
        } int i = 0; int i = 0; i 0 i < input.length i input.length input input.length i++ i++ i {
            if (input[i] == '1')
                System.out.print('9');
            else
                System.out.print('1');
        } {
            if (input[i] == '1')
                System.out.print('9');
            else
                System.out.print('1');
        } if (input[i] == '1')
                System.out.print('9');
            else
                System.out.print('1'); input[i] == '1' input[i] input i '1' System.out.print('9') System.out.print System.out System System.out '9' System.out.print('1') System.out.print System.out System System.out '1' System.out.println("") System.out.println System.out System System.out "" String[] args args public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        char[] input = sc.next().toCharArray();
        for (int i = 0; i < input.length; i++) {
            if (input[i] == '1')
                System.out.print('9');
            else
                System.out.print('1');
        }
        System.out.println("");
        
    }
} public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        char[] input = sc.next().toCharArray();
        for (int i = 0; i < input.length; i++) {
            if (input[i] == '1')
                System.out.print('9');
            else
                System.out.print('1');
        }
        System.out.println("");
        
    }
} Main
import java.util.List;
import java.util.Scanner;
import java.util.ArrayList;
import java.util.Arrays;

public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        char[] input = sc.next().toCharArray();
        for (int i = 0; i < input.length; i++) {
            if (input[i] == '1')
                System.out.print('9');
            else
                System.out.print('1');
        }
        System.out.println("");
        
    }
}