import java.util.*;

public class Main {
    public static void main(String[] args){
        Scanner scanner = new Scanner(System.in);
        String a = scanner.next();
        String b = "";
        for(char c : a.toCharArray()){
            b += a(c);
        }
        System.out.println(b);
    }
    static String a(char c){
        if(c == '1'){
            return "9";
        }else{
            return "1";
        }
    }
} import java.util.*; util.* java public class Main {
    public static void main(String[] args){
        Scanner scanner = new Scanner(System.in);
        String a = scanner.next();
        String b = "";
        for(char c : a.toCharArray()){
            b += a(c);
        }
        System.out.println(b);
    }
    static String a(char c){
        if(c == '1'){
            return "9";
        }else{
            return "1";
        }
    }
} Main public static void main(String[] args){
        Scanner scanner = new Scanner(System.in);
        String a = scanner.next();
        String b = "";
        for(char c : a.toCharArray()){
            b += a(c);
        }
        System.out.println(b);
    } main {
        Scanner scanner = new Scanner(System.in);
        String a = scanner.next();
        String b = "";
        for(char c : a.toCharArray()){
            b += a(c);
        }
        System.out.println(b);
    } Scanner scanner = new Scanner(System.in); scanner new Scanner(System.in) String a = scanner.next(); a scanner.next() scanner.next scanner String b = ""; b "" for(char c : a.toCharArray()){
            b += a(c);
        } char c a.toCharArray() a.toCharArray a {
            b += a(c);
        } {
            b += a(c);
        } b += a(c) b a(c) a c System.out.println(b) System.out.println System.out System System.out b String[] args args static String a(char c){
        if(c == '1'){
            return "9";
        }else{
            return "1";
        }
    } a {
        if(c == '1'){
            return "9";
        }else{
            return "1";
        }
    } if(c == '1'){
            return "9";
        }else{
            return "1";
        } c == '1' c '1' {
            return "9";
        } return "9"; "9" {
            return "1";
        } return "1"; "1" char c c public class Main {
    public static void main(String[] args){
        Scanner scanner = new Scanner(System.in);
        String a = scanner.next();
        String b = "";
        for(char c : a.toCharArray()){
            b += a(c);
        }
        System.out.println(b);
    }
    static String a(char c){
        if(c == '1'){
            return "9";
        }else{
            return "1";
        }
    }
} public class Main {
    public static void main(String[] args){
        Scanner scanner = new Scanner(System.in);
        String a = scanner.next();
        String b = "";
        for(char c : a.toCharArray()){
            b += a(c);
        }
        System.out.println(b);
    }
    static String a(char c){
        if(c == '1'){
            return "9";
        }else{
            return "1";
        }
    }
} Main
import java.util.*;

public class Main {
    public static void main(String[] args){
        Scanner scanner = new Scanner(System.in);
        String a = scanner.next();
        String b = "";
        for(char c : a.toCharArray()){
            b += a(c);
        }
        System.out.println(b);
    }
    static String a(char c){
        if(c == '1'){
            return "9";
        }else{
            return "1";
        }
    }
}