import java.util.*;

class Main {
	public static void main (String[] args) {
		Scanner sc=new Scanner(System.in); 
		String s=sc.next();
		int i=0;
		while(i<3){
		    if(s.charAt(i)=='1')
		        System.out.print("9");
		    else
		        System.out.print("1");
		  i++;
		}
	}
} import java.util.*; util.* java class Main {
	public static void main (String[] args) {
		Scanner sc=new Scanner(System.in); 
		String s=sc.next();
		int i=0;
		while(i<3){
		    if(s.charAt(i)=='1')
		        System.out.print("9");
		    else
		        System.out.print("1");
		  i++;
		}
	}
} Main public static void main (String[] args) {
		Scanner sc=new Scanner(System.in); 
		String s=sc.next();
		int i=0;
		while(i<3){
		    if(s.charAt(i)=='1')
		        System.out.print("9");
		    else
		        System.out.print("1");
		  i++;
		}
	} main {
		Scanner sc=new Scanner(System.in); 
		String s=sc.next();
		int i=0;
		while(i<3){
		    if(s.charAt(i)=='1')
		        System.out.print("9");
		    else
		        System.out.print("1");
		  i++;
		}
	} Scanner sc=new Scanner(System.in); sc new Scanner(System.in) String s=sc.next(); s sc.next() sc.next sc int i=0; i 0 while(i<3){
		    if(s.charAt(i)=='1')
		        System.out.print("9");
		    else
		        System.out.print("1");
		  i++;
		} i<3 i 3 {
		    if(s.charAt(i)=='1')
		        System.out.print("9");
		    else
		        System.out.print("1");
		  i++;
		} if(s.charAt(i)=='1')
		        System.out.print("9");
		    else
		        System.out.print("1"); s.charAt(i)=='1' s.charAt(i) s.charAt s i '1' System.out.print("9") System.out.print System.out System System.out "9" System.out.print("1") System.out.print System.out System System.out "1" i++ i String[] args args
import java.util.*;

class Main {
	public static void main (String[] args) {
		Scanner sc=new Scanner(System.in); 
		String s=sc.next();
		int i=0;
		while(i<3){
		    if(s.charAt(i)=='1')
		        System.out.print("9");
		    else
		        System.out.print("1");
		  i++;
		}
	}
}