import java.util.*;
import java.util.Collections;
import java.util.ArrayList;

public class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);

        String n = sc.next();
        String ans = "";
        String x = "1";

        for(int i=0; i<3; i++){
            if(n.charAt(i)==x.charAt(0)){
                ans += "9";
            }
            else{
                ans += "1";
            }
        }
        System.out.println(ans);
    }
} import java.util.*; util.* java import java.util.Collections; Collections java.util import java.util.ArrayList; ArrayList java.util public class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);

        String n = sc.next();
        String ans = "";
        String x = "1";

        for(int i=0; i<3; i++){
            if(n.charAt(i)==x.charAt(0)){
                ans += "9";
            }
            else{
                ans += "1";
            }
        }
        System.out.println(ans);
    }
} Main public static void main(String[] args){
        Scanner sc = new Scanner(System.in);

        String n = sc.next();
        String ans = "";
        String x = "1";

        for(int i=0; i<3; i++){
            if(n.charAt(i)==x.charAt(0)){
                ans += "9";
            }
            else{
                ans += "1";
            }
        }
        System.out.println(ans);
    } main {
        Scanner sc = new Scanner(System.in);

        String n = sc.next();
        String ans = "";
        String x = "1";

        for(int i=0; i<3; i++){
            if(n.charAt(i)==x.charAt(0)){
                ans += "9";
            }
            else{
                ans += "1";
            }
        }
        System.out.println(ans);
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String n = sc.next(); n sc.next() sc.next sc String ans = ""; ans "" String x = "1"; x "1" for(int i=0; i<3; i++){
            if(n.charAt(i)==x.charAt(0)){
                ans += "9";
            }
            else{
                ans += "1";
            }
        } int i=0; int i=0; i 0 i<3 i 3 i++ i++ i {
            if(n.charAt(i)==x.charAt(0)){
                ans += "9";
            }
            else{
                ans += "1";
            }
        } {
            if(n.charAt(i)==x.charAt(0)){
                ans += "9";
            }
            else{
                ans += "1";
            }
        } if(n.charAt(i)==x.charAt(0)){
                ans += "9";
            }
            else{
                ans += "1";
            } n.charAt(i)==x.charAt(0) n.charAt(i) n.charAt n i x.charAt(0) x.charAt x 0 {
                ans += "9";
            } ans += "9" ans "9" {
                ans += "1";
            } ans += "1" ans "1" System.out.println(ans) System.out.println System.out System System.out ans String[] args args public class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);

        String n = sc.next();
        String ans = "";
        String x = "1";

        for(int i=0; i<3; i++){
            if(n.charAt(i)==x.charAt(0)){
                ans += "9";
            }
            else{
                ans += "1";
            }
        }
        System.out.println(ans);
    }
} public class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);

        String n = sc.next();
        String ans = "";
        String x = "1";

        for(int i=0; i<3; i++){
            if(n.charAt(i)==x.charAt(0)){
                ans += "9";
            }
            else{
                ans += "1";
            }
        }
        System.out.println(ans);
    }
} Main
import java.util.*;
import java.util.Collections;
import java.util.ArrayList;

public class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);

        String n = sc.next();
        String ans = "";
        String x = "1";

        for(int i=0; i<3; i++){
            if(n.charAt(i)==x.charAt(0)){
                ans += "9";
            }
            else{
                ans += "1";
            }
        }
        System.out.println(ans);
    }
}