import java.io.BufferedReader;
import java.io.InputStreamReader;

public class Main {
    public static void main(String[] args)throws Exception {
        BufferedReader input = new BufferedReader(new InputStreamReader(System.in));
        StringBuilder word = new StringBuilder(input.readLine());
        for (int i = 0; i < word.length(); i++) {
            if (word.charAt(i) == '1'){
                word.setCharAt(i, '9');
            }else{
                word.setCharAt(i, '1');
            }
        }
        System.out.println(word);
    }
} import java.io.BufferedReader; BufferedReader java.io import java.io.InputStreamReader; InputStreamReader java.io public class Main {
    public static void main(String[] args)throws Exception {
        BufferedReader input = new BufferedReader(new InputStreamReader(System.in));
        StringBuilder word = new StringBuilder(input.readLine());
        for (int i = 0; i < word.length(); i++) {
            if (word.charAt(i) == '1'){
                word.setCharAt(i, '9');
            }else{
                word.setCharAt(i, '1');
            }
        }
        System.out.println(word);
    }
} Main public static void main(String[] args)throws Exception {
        BufferedReader input = new BufferedReader(new InputStreamReader(System.in));
        StringBuilder word = new StringBuilder(input.readLine());
        for (int i = 0; i < word.length(); i++) {
            if (word.charAt(i) == '1'){
                word.setCharAt(i, '9');
            }else{
                word.setCharAt(i, '1');
            }
        }
        System.out.println(word);
    } main {
        BufferedReader input = new BufferedReader(new InputStreamReader(System.in));
        StringBuilder word = new StringBuilder(input.readLine());
        for (int i = 0; i < word.length(); i++) {
            if (word.charAt(i) == '1'){
                word.setCharAt(i, '9');
            }else{
                word.setCharAt(i, '1');
            }
        }
        System.out.println(word);
    } BufferedReader input = new BufferedReader(new InputStreamReader(System.in)); input new BufferedReader(new InputStreamReader(System.in)) StringBuilder word = new StringBuilder(input.readLine()); word new StringBuilder(input.readLine()) for (int i = 0; i < word.length(); i++) {
            if (word.charAt(i) == '1'){
                word.setCharAt(i, '9');
            }else{
                word.setCharAt(i, '1');
            }
        } int i = 0; int i = 0; i 0 i < word.length() i word.length() word.length word i++ i++ i {
            if (word.charAt(i) == '1'){
                word.setCharAt(i, '9');
            }else{
                word.setCharAt(i, '1');
            }
        } {
            if (word.charAt(i) == '1'){
                word.setCharAt(i, '9');
            }else{
                word.setCharAt(i, '1');
            }
        } if (word.charAt(i) == '1'){
                word.setCharAt(i, '9');
            }else{
                word.setCharAt(i, '1');
            } word.charAt(i) == '1' word.charAt(i) word.charAt word i '1' {
                word.setCharAt(i, '9');
            } word.setCharAt(i, '9') word.setCharAt word i '9' {
                word.setCharAt(i, '1');
            } word.setCharAt(i, '1') word.setCharAt word i '1' System.out.println(word) System.out.println System.out System System.out word String[] args args public class Main {
    public static void main(String[] args)throws Exception {
        BufferedReader input = new BufferedReader(new InputStreamReader(System.in));
        StringBuilder word = new StringBuilder(input.readLine());
        for (int i = 0; i < word.length(); i++) {
            if (word.charAt(i) == '1'){
                word.setCharAt(i, '9');
            }else{
                word.setCharAt(i, '1');
            }
        }
        System.out.println(word);
    }
} public class Main {
    public static void main(String[] args)throws Exception {
        BufferedReader input = new BufferedReader(new InputStreamReader(System.in));
        StringBuilder word = new StringBuilder(input.readLine());
        for (int i = 0; i < word.length(); i++) {
            if (word.charAt(i) == '1'){
                word.setCharAt(i, '9');
            }else{
                word.setCharAt(i, '1');
            }
        }
        System.out.println(word);
    }
} Main
import java.io.BufferedReader;
import java.io.InputStreamReader;

public class Main {
    public static void main(String[] args)throws Exception {
        BufferedReader input = new BufferedReader(new InputStreamReader(System.in));
        StringBuilder word = new StringBuilder(input.readLine());
        for (int i = 0; i < word.length(); i++) {
            if (word.charAt(i) == '1'){
                word.setCharAt(i, '9');
            }else{
                word.setCharAt(i, '1');
            }
        }
        System.out.println(word);
    }
}
