
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.math.BigDecimal;
import java.util.Arrays;
import java.util.StringTokenizer;

import java.util.Scanner;
public class Main {
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        String c = sc.next();
        String c1 = String.valueOf(c.charAt(0));
        String c2 = String.valueOf(c.charAt(1));
        String c3 = String.valueOf(c.charAt(2));
        
        c1=change19(c1);
        c2=change19(c2);
        c3=change19(c3);
        
    	System.out.println(c1 + c2 + c3);   
    
    }
    private static String change19(String str) {
    	if ("1".equals(str)) {
    		str="9";
    	} else if ("9".equals(str)) {
    		str="1";
    	}
    	
    	return str;
    }
} import java.io.BufferedReader; BufferedReader java.io import java.io.InputStreamReader; InputStreamReader java.io import java.math.BigDecimal; BigDecimal java.math import java.util.Arrays; Arrays java.util import java.util.StringTokenizer; StringTokenizer java.util import java.util.Scanner; Scanner java.util public class Main {
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        String c = sc.next();
        String c1 = String.valueOf(c.charAt(0));
        String c2 = String.valueOf(c.charAt(1));
        String c3 = String.valueOf(c.charAt(2));
        
        c1=change19(c1);
        c2=change19(c2);
        c3=change19(c3);
        
    	System.out.println(c1 + c2 + c3);   
    
    }
    private static String change19(String str) {
    	if ("1".equals(str)) {
    		str="9";
    	} else if ("9".equals(str)) {
    		str="1";
    	}
    	
    	return str;
    }
} Main public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        String c = sc.next();
        String c1 = String.valueOf(c.charAt(0));
        String c2 = String.valueOf(c.charAt(1));
        String c3 = String.valueOf(c.charAt(2));
        
        c1=change19(c1);
        c2=change19(c2);
        c3=change19(c3);
        
    	System.out.println(c1 + c2 + c3);   
    
    } main {
        Scanner sc = new Scanner(System.in);
        String c = sc.next();
        String c1 = String.valueOf(c.charAt(0));
        String c2 = String.valueOf(c.charAt(1));
        String c3 = String.valueOf(c.charAt(2));
        
        c1=change19(c1);
        c2=change19(c2);
        c3=change19(c3);
        
    	System.out.println(c1 + c2 + c3);   
    
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String c = sc.next(); c sc.next() sc.next sc String c1 = String.valueOf(c.charAt(0)); c1 String.valueOf(c.charAt(0)) String.valueOf String c.charAt(0) c.charAt c 0 String c2 = String.valueOf(c.charAt(1)); c2 String.valueOf(c.charAt(1)) String.valueOf String c.charAt(1) c.charAt c 1 String c3 = String.valueOf(c.charAt(2)); c3 String.valueOf(c.charAt(2)) String.valueOf String c.charAt(2) c.charAt c 2 c1=change19(c1) c1 change19(c1) change19 c1 c2=change19(c2) c2 change19(c2) change19 c2 c3=change19(c3) c3 change19(c3) change19 c3 System.out.println(c1 + c2 + c3) System.out.println System.out System System.out c1 + c2 + c3 c1 + c2 + c3 c1 c2 c3 String[] args args private static String change19(String str) {
    	if ("1".equals(str)) {
    		str="9";
    	} else if ("9".equals(str)) {
    		str="1";
    	}
    	
    	return str;
    } change19 {
    	if ("1".equals(str)) {
    		str="9";
    	} else if ("9".equals(str)) {
    		str="1";
    	}
    	
    	return str;
    } if ("1".equals(str)) {
    		str="9";
    	} else if ("9".equals(str)) {
    		str="1";
    	} "1".equals(str) "1".equals "1" str {
    		str="9";
    	} str="9" str "9" if ("9".equals(str)) {
    		str="1";
    	} "9".equals(str) "9".equals "9" str {
    		str="1";
    	} str="1" str "1" return str; str String str str public class Main {
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        String c = sc.next();
        String c1 = String.valueOf(c.charAt(0));
        String c2 = String.valueOf(c.charAt(1));
        String c3 = String.valueOf(c.charAt(2));
        
        c1=change19(c1);
        c2=change19(c2);
        c3=change19(c3);
        
    	System.out.println(c1 + c2 + c3);   
    
    }
    private static String change19(String str) {
    	if ("1".equals(str)) {
    		str="9";
    	} else if ("9".equals(str)) {
    		str="1";
    	}
    	
    	return str;
    }
} public class Main {
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        String c = sc.next();
        String c1 = String.valueOf(c.charAt(0));
        String c2 = String.valueOf(c.charAt(1));
        String c3 = String.valueOf(c.charAt(2));
        
        c1=change19(c1);
        c2=change19(c2);
        c3=change19(c3);
        
    	System.out.println(c1 + c2 + c3);   
    
    }
    private static String change19(String str) {
    	if ("1".equals(str)) {
    		str="9";
    	} else if ("9".equals(str)) {
    		str="1";
    	}
    	
    	return str;
    }
} Main

import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.math.BigDecimal;
import java.util.Arrays;
import java.util.StringTokenizer;

import java.util.Scanner;
public class Main {
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        String c = sc.next();
        String c1 = String.valueOf(c.charAt(0));
        String c2 = String.valueOf(c.charAt(1));
        String c3 = String.valueOf(c.charAt(2));
        
        c1=change19(c1);
        c2=change19(c2);
        c3=change19(c3);
        
    	System.out.println(c1 + c2 + c3);   
    
    }
    private static String change19(String str) {
    	if ("1".equals(str)) {
    		str="9";
    	} else if ("9".equals(str)) {
    		str="1";
    	}
    	
    	return str;
    }
}