import java.io.*;

class Main
{
    public static void main(String[] args) throws IOException
    {
	BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

	String  str = br.readLine();

	String[] ar = str.split("");

	for(int i=0; i<str.length(); i++){
	    if(ar[i].equals("9"))
		ar[i]="1";
	    else if(ar[i].equals("1"))
		ar[i]="9";
	}
	
	System.out.println(ar[0]+ar[1]+ar[2]);
    }
} import java.io.*; io.* java class Main
{
    public static void main(String[] args) throws IOException
    {
	BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

	String  str = br.readLine();

	String[] ar = str.split("");

	for(int i=0; i<str.length(); i++){
	    if(ar[i].equals("9"))
		ar[i]="1";
	    else if(ar[i].equals("1"))
		ar[i]="9";
	}
	
	System.out.println(ar[0]+ar[1]+ar[2]);
    }
} Main public static void main(String[] args) throws IOException
    {
	BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

	String  str = br.readLine();

	String[] ar = str.split("");

	for(int i=0; i<str.length(); i++){
	    if(ar[i].equals("9"))
		ar[i]="1";
	    else if(ar[i].equals("1"))
		ar[i]="9";
	}
	
	System.out.println(ar[0]+ar[1]+ar[2]);
    } main {
	BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

	String  str = br.readLine();

	String[] ar = str.split("");

	for(int i=0; i<str.length(); i++){
	    if(ar[i].equals("9"))
		ar[i]="1";
	    else if(ar[i].equals("1"))
		ar[i]="9";
	}
	
	System.out.println(ar[0]+ar[1]+ar[2]);
    } BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) String  str = br.readLine(); str br.readLine() br.readLine br String[] ar = str.split(""); ar str.split("") str.split str "" for(int i=0; i<str.length(); i++){
	    if(ar[i].equals("9"))
		ar[i]="1";
	    else if(ar[i].equals("1"))
		ar[i]="9";
	} int i=0; int i=0; i 0 i<str.length() i str.length() str.length str i++ i++ i {
	    if(ar[i].equals("9"))
		ar[i]="1";
	    else if(ar[i].equals("1"))
		ar[i]="9";
	} {
	    if(ar[i].equals("9"))
		ar[i]="1";
	    else if(ar[i].equals("1"))
		ar[i]="9";
	} if(ar[i].equals("9"))
		ar[i]="1";
	    else if(ar[i].equals("1"))
		ar[i]="9"; ar[i].equals("9") ar[i].equals ar[i] ar i "9" ar[i]="1" ar[i] ar i "1" if(ar[i].equals("1"))
		ar[i]="9"; ar[i].equals("1") ar[i].equals ar[i] ar i "1" ar[i]="9" ar[i] ar i "9" System.out.println(ar[0]+ar[1]+ar[2]) System.out.println System.out System System.out ar[0]+ar[1]+ar[2] ar[0]+ar[1]+ar[2] ar[0] ar 0 ar[1] ar 1 ar[2] ar 2 String[] args args
import java.io.*;

class Main
{
    public static void main(String[] args) throws IOException
    {
	BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

	String  str = br.readLine();

	String[] ar = str.split("");

	for(int i=0; i<str.length(); i++){
	    if(ar[i].equals("9"))
		ar[i]="1";
	    else if(ar[i].equals("1"))
		ar[i]="9";
	}
	
	System.out.println(ar[0]+ar[1]+ar[2]);
    }
}