/*package whatever //do not write package name here */

import java.util.*;
class Main {
	public static void main (String[] args) {
		Scanner sc = new Scanner(System.in);
		String str = sc.nextLine(),ans="";
		for(int i=0 ; i<str.length() ; i++){
		    if(str.charAt(i)=='1'){
		        ans+=9;
		    }else{
		        ans+=1;
		    }
		}
		System.out.println(ans);
	}
} import java.util.*; util.* java class Main {
	public static void main (String[] args) {
		Scanner sc = new Scanner(System.in);
		String str = sc.nextLine(),ans="";
		for(int i=0 ; i<str.length() ; i++){
		    if(str.charAt(i)=='1'){
		        ans+=9;
		    }else{
		        ans+=1;
		    }
		}
		System.out.println(ans);
	}
} Main public static void main (String[] args) {
		Scanner sc = new Scanner(System.in);
		String str = sc.nextLine(),ans="";
		for(int i=0 ; i<str.length() ; i++){
		    if(str.charAt(i)=='1'){
		        ans+=9;
		    }else{
		        ans+=1;
		    }
		}
		System.out.println(ans);
	} main {
		Scanner sc = new Scanner(System.in);
		String str = sc.nextLine(),ans="";
		for(int i=0 ; i<str.length() ; i++){
		    if(str.charAt(i)=='1'){
		        ans+=9;
		    }else{
		        ans+=1;
		    }
		}
		System.out.println(ans);
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String str = sc.nextLine() str sc.nextLine() sc.nextLine sc ans=""; ans "" for(int i=0 ; i<str.length() ; i++){
		    if(str.charAt(i)=='1'){
		        ans+=9;
		    }else{
		        ans+=1;
		    }
		} int i=0 ; int i=0 ; i 0 i<str.length() i str.length() str.length str i++ i++ i {
		    if(str.charAt(i)=='1'){
		        ans+=9;
		    }else{
		        ans+=1;
		    }
		} {
		    if(str.charAt(i)=='1'){
		        ans+=9;
		    }else{
		        ans+=1;
		    }
		} if(str.charAt(i)=='1'){
		        ans+=9;
		    }else{
		        ans+=1;
		    } str.charAt(i)=='1' str.charAt(i) str.charAt str i '1' {
		        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
/*package whatever //do not write package name here */

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