import java.util.*;
import java.io.*;

public class Main {
    public static void main(String[] args) throws Exception {
        BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
        String nums = reader.readLine();
        StringBuilder result = new StringBuilder();
        for(int i = 0; i<nums.length(); i++){
            String n = nums.charAt(i) == '1' ? "9" : "1";
            result.append(n);
        }
        System.out.println(result);
    }
} import java.util.*; util.* java import java.io.*; io.* java public class Main {
    public static void main(String[] args) throws Exception {
        BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
        String nums = reader.readLine();
        StringBuilder result = new StringBuilder();
        for(int i = 0; i<nums.length(); i++){
            String n = nums.charAt(i) == '1' ? "9" : "1";
            result.append(n);
        }
        System.out.println(result);
    }
} Main public static void main(String[] args) throws Exception {
        BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
        String nums = reader.readLine();
        StringBuilder result = new StringBuilder();
        for(int i = 0; i<nums.length(); i++){
            String n = nums.charAt(i) == '1' ? "9" : "1";
            result.append(n);
        }
        System.out.println(result);
    } main {
        BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
        String nums = reader.readLine();
        StringBuilder result = new StringBuilder();
        for(int i = 0; i<nums.length(); i++){
            String n = nums.charAt(i) == '1' ? "9" : "1";
            result.append(n);
        }
        System.out.println(result);
    } BufferedReader reader = new BufferedReader(new InputStreamReader(System.in)); reader new BufferedReader(new InputStreamReader(System.in)) String nums = reader.readLine(); nums reader.readLine() reader.readLine reader StringBuilder result = new StringBuilder(); result new StringBuilder() for(int i = 0; i<nums.length(); i++){
            String n = nums.charAt(i) == '1' ? "9" : "1";
            result.append(n);
        } int i = 0; int i = 0; i 0 i<nums.length() i nums.length() nums.length nums i++ i++ i {
            String n = nums.charAt(i) == '1' ? "9" : "1";
            result.append(n);
        } {
            String n = nums.charAt(i) == '1' ? "9" : "1";
            result.append(n);
        } String n = nums.charAt(i) == '1' ? "9" : "1"; n nums.charAt(i) == '1' ? "9" : "1" nums.charAt(i) == '1' nums.charAt(i) nums.charAt nums i '1' "9" "1" result.append(n) result.append result n System.out.println(result) System.out.println System.out System System.out result String[] args args public class Main {
    public static void main(String[] args) throws Exception {
        BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
        String nums = reader.readLine();
        StringBuilder result = new StringBuilder();
        for(int i = 0; i<nums.length(); i++){
            String n = nums.charAt(i) == '1' ? "9" : "1";
            result.append(n);
        }
        System.out.println(result);
    }
} public class Main {
    public static void main(String[] args) throws Exception {
        BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
        String nums = reader.readLine();
        StringBuilder result = new StringBuilder();
        for(int i = 0; i<nums.length(); i++){
            String n = nums.charAt(i) == '1' ? "9" : "1";
            result.append(n);
        }
        System.out.println(result);
    }
} Main
import java.util.*;
import java.io.*;

public class Main {
    public static void main(String[] args) throws Exception {
        BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
        String nums = reader.readLine();
        StringBuilder result = new StringBuilder();
        for(int i = 0; i<nums.length(); i++){
            String n = nums.charAt(i) == '1' ? "9" : "1";
            result.append(n);
        }
        System.out.println(result);
    }
}
