import java.util.*;
public class Main{
    public static void main(String args[]){
        Scanner sc = new Scanner(System.in);
        
        String input2 = sc.nextLine();
        int len = input2.length();
        int input = Integer.parseInt(input2);
        int judge [] = new int[len];
        for(int i = 0 ; i<len; i++){
            judge[i]=input%10;
            input = input/10;
        }
        for(int i = len-1 ; i>=0 ; i--){
            System.out.print(10-judge[i]);
        }
    //    System.out.print("1");
    //    System.out.print("2");
    }
} import java.util.*; util.* java public class Main{
    public static void main(String args[]){
        Scanner sc = new Scanner(System.in);
        
        String input2 = sc.nextLine();
        int len = input2.length();
        int input = Integer.parseInt(input2);
        int judge [] = new int[len];
        for(int i = 0 ; i<len; i++){
            judge[i]=input%10;
            input = input/10;
        }
        for(int i = len-1 ; i>=0 ; i--){
            System.out.print(10-judge[i]);
        }
    //    System.out.print("1");
    //    System.out.print("2");
    }
} Main public static void main(String args[]){
        Scanner sc = new Scanner(System.in);
        
        String input2 = sc.nextLine();
        int len = input2.length();
        int input = Integer.parseInt(input2);
        int judge [] = new int[len];
        for(int i = 0 ; i<len; i++){
            judge[i]=input%10;
            input = input/10;
        }
        for(int i = len-1 ; i>=0 ; i--){
            System.out.print(10-judge[i]);
        }
    //    System.out.print("1");
    //    System.out.print("2");
    } main {
        Scanner sc = new Scanner(System.in);
        
        String input2 = sc.nextLine();
        int len = input2.length();
        int input = Integer.parseInt(input2);
        int judge [] = new int[len];
        for(int i = 0 ; i<len; i++){
            judge[i]=input%10;
            input = input/10;
        }
        for(int i = len-1 ; i>=0 ; i--){
            System.out.print(10-judge[i]);
        }
    //    System.out.print("1");
    //    System.out.print("2");
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String input2 = sc.nextLine(); input2 sc.nextLine() sc.nextLine sc int len = input2.length(); len input2.length() input2.length input2 int input = Integer.parseInt(input2); input Integer.parseInt(input2) Integer.parseInt Integer input2 int judge [] = new int[len]; judge new int[len] len for(int i = 0 ; i<len; i++){
            judge[i]=input%10;
            input = input/10;
        } int i = 0 ; int i = 0 ; i 0 i<len i len i++ i++ i {
            judge[i]=input%10;
            input = input/10;
        } {
            judge[i]=input%10;
            input = input/10;
        } judge[i]=input%10 judge[i] judge i input%10 input 10 input = input/10 input input/10 input 10 for(int i = len-1 ; i>=0 ; i--){
            System.out.print(10-judge[i]);
        } int i = len-1 ; int i = len-1 ; i len-1 len 1 i>=0 i 0 i-- i-- i {
            System.out.print(10-judge[i]);
        } {
            System.out.print(10-judge[i]);
        } System.out.print(10-judge[i]) System.out.print System.out System System.out 10-judge[i] 10 judge[i] judge i String args[] args public class Main{
    public static void main(String args[]){
        Scanner sc = new Scanner(System.in);
        
        String input2 = sc.nextLine();
        int len = input2.length();
        int input = Integer.parseInt(input2);
        int judge [] = new int[len];
        for(int i = 0 ; i<len; i++){
            judge[i]=input%10;
            input = input/10;
        }
        for(int i = len-1 ; i>=0 ; i--){
            System.out.print(10-judge[i]);
        }
    //    System.out.print("1");
    //    System.out.print("2");
    }
} public class Main{
    public static void main(String args[]){
        Scanner sc = new Scanner(System.in);
        
        String input2 = sc.nextLine();
        int len = input2.length();
        int input = Integer.parseInt(input2);
        int judge [] = new int[len];
        for(int i = 0 ; i<len; i++){
            judge[i]=input%10;
            input = input/10;
        }
        for(int i = len-1 ; i>=0 ; i--){
            System.out.print(10-judge[i]);
        }
    //    System.out.print("1");
    //    System.out.print("2");
    }
} Main
import java.util.*;
public class Main{
    public static void main(String args[]){
        Scanner sc = new Scanner(System.in);
        
        String input2 = sc.nextLine();
        int len = input2.length();
        int input = Integer.parseInt(input2);
        int judge [] = new int[len];
        for(int i = 0 ; i<len; i++){
            judge[i]=input%10;
            input = input/10;
        }
        for(int i = len-1 ; i>=0 ; i--){
            System.out.print(10-judge[i]);
        }
    //    System.out.print("1");
    //    System.out.print("2");
    }
}