import java.util.*;
import java.lang.*;
import java.io.*;
import java.util.Scanner;
/* Name of the class has to be "Main" only if the class is public. */
class Main
{
	public static void main (String[] args) throws java.lang.Exception
	{   
	    Scanner sc = new Scanner(System.in);
	    String s = sc.next();
	    char[] chars = s.toCharArray();
	    for(char c : chars) {
	        if(c=='1') {
	            System.out.print(9);
	        } else {
	            System.out.print(1);
	        }
	    }
	    
	    
	}
} import java.util.*; util.* java import java.lang.*; lang.* java import java.io.*; io.* java import java.util.Scanner; Scanner java.util class Main
{
	public static void main (String[] args) throws java.lang.Exception
	{   
	    Scanner sc = new Scanner(System.in);
	    String s = sc.next();
	    char[] chars = s.toCharArray();
	    for(char c : chars) {
	        if(c=='1') {
	            System.out.print(9);
	        } else {
	            System.out.print(1);
	        }
	    }
	    
	    
	}
} Main public static void main (String[] args) throws java.lang.Exception
	{   
	    Scanner sc = new Scanner(System.in);
	    String s = sc.next();
	    char[] chars = s.toCharArray();
	    for(char c : chars) {
	        if(c=='1') {
	            System.out.print(9);
	        } else {
	            System.out.print(1);
	        }
	    }
	    
	    
	} main {   
	    Scanner sc = new Scanner(System.in);
	    String s = sc.next();
	    char[] chars = s.toCharArray();
	    for(char c : chars) {
	        if(c=='1') {
	            System.out.print(9);
	        } else {
	            System.out.print(1);
	        }
	    }
	    
	    
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String s = sc.next(); s sc.next() sc.next sc char[] chars = s.toCharArray(); chars s.toCharArray() s.toCharArray s for(char c : chars) {
	        if(c=='1') {
	            System.out.print(9);
	        } else {
	            System.out.print(1);
	        }
	    } char c chars {
	        if(c=='1') {
	            System.out.print(9);
	        } else {
	            System.out.print(1);
	        }
	    } {
	        if(c=='1') {
	            System.out.print(9);
	        } else {
	            System.out.print(1);
	        }
	    } if(c=='1') {
	            System.out.print(9);
	        } else {
	            System.out.print(1);
	        } c=='1' c '1' {
	            System.out.print(9);
	        } System.out.print(9) System.out.print System.out System System.out 9 {
	            System.out.print(1);
	        } System.out.print(1) System.out.print System.out System System.out 1 String[] args args
import java.util.*;
import java.lang.*;
import java.io.*;
import java.util.Scanner;
/* Name of the class has to be "Main" only if the class is public. */
class Main
{
	public static void main (String[] args) throws java.lang.Exception
	{   
	    Scanner sc = new Scanner(System.in);
	    String s = sc.next();
	    char[] chars = s.toCharArray();
	    for(char c : chars) {
	        if(c=='1') {
	            System.out.print(9);
	        } else {
	            System.out.print(1);
	        }
	    }
	    
	    
	}
}
