import java.util.Scanner;
import java.util.Comparator;
import java.util.PriorityQueue;
import java.util.Arrays;

public class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        char[] a = sc.next().toCharArray();
        String Ans = "";
        for (int i=0;i<3;i++){Ans += (a[i]=='1')?"9":"1";}
        System.out.println(Ans);
        sc.close();
    }
} import java.util.Scanner; Scanner java.util import java.util.Comparator; Comparator java.util import java.util.PriorityQueue; PriorityQueue 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[] a = sc.next().toCharArray();
        String Ans = "";
        for (int i=0;i<3;i++){Ans += (a[i]=='1')?"9":"1";}
        System.out.println(Ans);
        sc.close();
    }
} Main public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        char[] a = sc.next().toCharArray();
        String Ans = "";
        for (int i=0;i<3;i++){Ans += (a[i]=='1')?"9":"1";}
        System.out.println(Ans);
        sc.close();
    } main {
        Scanner sc = new Scanner(System.in);
        char[] a = sc.next().toCharArray();
        String Ans = "";
        for (int i=0;i<3;i++){Ans += (a[i]=='1')?"9":"1";}
        System.out.println(Ans);
        sc.close();
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) char[] a = sc.next().toCharArray(); a sc.next().toCharArray() sc.next().toCharArray sc.next() sc.next sc String Ans = ""; Ans "" for (int i=0;i<3;i++){Ans += (a[i]=='1')?"9":"1";} int i=0; int i=0; i 0 i<3 i 3 i++ i++ i {Ans += (a[i]=='1')?"9":"1";} {Ans += (a[i]=='1')?"9":"1";} Ans += (a[i]=='1')?"9":"1" Ans (a[i]=='1')?"9":"1" (a[i]=='1') a[i] a i '1' "9" "1" System.out.println(Ans) System.out.println System.out System System.out Ans sc.close() sc.close sc String[] args args public class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        char[] a = sc.next().toCharArray();
        String Ans = "";
        for (int i=0;i<3;i++){Ans += (a[i]=='1')?"9":"1";}
        System.out.println(Ans);
        sc.close();
    }
} public class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        char[] a = sc.next().toCharArray();
        String Ans = "";
        for (int i=0;i<3;i++){Ans += (a[i]=='1')?"9":"1";}
        System.out.println(Ans);
        sc.close();
    }
} Main
import java.util.Scanner;
import java.util.Comparator;
import java.util.PriorityQueue;
import java.util.Arrays;

public class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        char[] a = sc.next().toCharArray();
        String Ans = "";
        for (int i=0;i<3;i++){Ans += (a[i]=='1')?"9":"1";}
        System.out.println(Ans);
        sc.close();
    }
}