import java.util.Scanner;

public class Main {
static int ans,N;
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String s=sc.nextLine();
        String S[]=s.split("");
        s="";
        for(int i=0;i<S.length;i++) {
        	s+=10-Integer.parseInt(S[i]);
        }
System.out.println(s);
        }
    } import java.util.Scanner; Scanner java.util public class Main {
static int ans,N;
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String s=sc.nextLine();
        String S[]=s.split("");
        s="";
        for(int i=0;i<S.length;i++) {
        	s+=10-Integer.parseInt(S[i]);
        }
System.out.println(s);
        }
    } Main static int ans ans N; N public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String s=sc.nextLine();
        String S[]=s.split("");
        s="";
        for(int i=0;i<S.length;i++) {
        	s+=10-Integer.parseInt(S[i]);
        }
System.out.println(s);
        } main {
        Scanner sc = new Scanner(System.in);
        String s=sc.nextLine();
        String S[]=s.split("");
        s="";
        for(int i=0;i<S.length;i++) {
        	s+=10-Integer.parseInt(S[i]);
        }
System.out.println(s);
        } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String s=sc.nextLine(); s sc.nextLine() sc.nextLine sc String S[]=s.split(""); S s.split("") s.split s "" s="" s "" for(int i=0;i<S.length;i++) {
        	s+=10-Integer.parseInt(S[i]);
        } int i=0; int i=0; i 0 i<S.length i S.length S S.length i++ i++ i {
        	s+=10-Integer.parseInt(S[i]);
        } {
        	s+=10-Integer.parseInt(S[i]);
        } s+=10-Integer.parseInt(S[i]) s 10-Integer.parseInt(S[i]) 10 Integer.parseInt(S[i]) Integer.parseInt Integer S[i] S i System.out.println(s) System.out.println System.out System System.out s String[] args args public class Main {
static int ans,N;
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String s=sc.nextLine();
        String S[]=s.split("");
        s="";
        for(int i=0;i<S.length;i++) {
        	s+=10-Integer.parseInt(S[i]);
        }
System.out.println(s);
        }
    } public class Main {
static int ans,N;
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String s=sc.nextLine();
        String S[]=s.split("");
        s="";
        for(int i=0;i<S.length;i++) {
        	s+=10-Integer.parseInt(S[i]);
        }
System.out.println(s);
        }
    } Main
import java.util.Scanner;

public class Main {
static int ans,N;
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String s=sc.nextLine();
        String S[]=s.split("");
        s="";
        for(int i=0;i<S.length;i++) {
        	s+=10-Integer.parseInt(S[i]);
        }
System.out.println(s);
        }
    }