import java.util.Scanner;

public class Main {

	@SuppressWarnings("resource")
	public static void main(String args[]) {
		Scanner scanner = new Scanner(System.in);
		String s=String.valueOf(scanner.nextInt());
		
		String ans="";
		for(int i=0;i<3;i++) {
			char c=s.charAt(i);
			if(c=='1')ans+="9";
			else ans+="1";
		}
		
		System.out.println(Integer.parseInt(ans));
	}
} import java.util.Scanner; Scanner java.util public class Main {

	@SuppressWarnings("resource")
	public static void main(String args[]) {
		Scanner scanner = new Scanner(System.in);
		String s=String.valueOf(scanner.nextInt());
		
		String ans="";
		for(int i=0;i<3;i++) {
			char c=s.charAt(i);
			if(c=='1')ans+="9";
			else ans+="1";
		}
		
		System.out.println(Integer.parseInt(ans));
	}
} Main @SuppressWarnings("resource")
	public static void main(String args[]) {
		Scanner scanner = new Scanner(System.in);
		String s=String.valueOf(scanner.nextInt());
		
		String ans="";
		for(int i=0;i<3;i++) {
			char c=s.charAt(i);
			if(c=='1')ans+="9";
			else ans+="1";
		}
		
		System.out.println(Integer.parseInt(ans));
	} main {
		Scanner scanner = new Scanner(System.in);
		String s=String.valueOf(scanner.nextInt());
		
		String ans="";
		for(int i=0;i<3;i++) {
			char c=s.charAt(i);
			if(c=='1')ans+="9";
			else ans+="1";
		}
		
		System.out.println(Integer.parseInt(ans));
	} Scanner scanner = new Scanner(System.in); scanner new Scanner(System.in) String s=String.valueOf(scanner.nextInt()); s String.valueOf(scanner.nextInt()) String.valueOf String scanner.nextInt() scanner.nextInt scanner String ans=""; ans "" for(int i=0;i<3;i++) {
			char c=s.charAt(i);
			if(c=='1')ans+="9";
			else ans+="1";
		} int i=0; int i=0; i 0 i<3 i 3 i++ i++ i {
			char c=s.charAt(i);
			if(c=='1')ans+="9";
			else ans+="1";
		} {
			char c=s.charAt(i);
			if(c=='1')ans+="9";
			else ans+="1";
		} char c=s.charAt(i); c s.charAt(i) s.charAt s i if(c=='1')ans+="9";
			else ans+="1"; c=='1' c '1' ans+="9" ans "9" ans+="1" ans "1" System.out.println(Integer.parseInt(ans)) System.out.println System.out System System.out Integer.parseInt(ans) Integer.parseInt Integer ans String args[] args public class Main {

	@SuppressWarnings("resource")
	public static void main(String args[]) {
		Scanner scanner = new Scanner(System.in);
		String s=String.valueOf(scanner.nextInt());
		
		String ans="";
		for(int i=0;i<3;i++) {
			char c=s.charAt(i);
			if(c=='1')ans+="9";
			else ans+="1";
		}
		
		System.out.println(Integer.parseInt(ans));
	}
} public class Main {

	@SuppressWarnings("resource")
	public static void main(String args[]) {
		Scanner scanner = new Scanner(System.in);
		String s=String.valueOf(scanner.nextInt());
		
		String ans="";
		for(int i=0;i<3;i++) {
			char c=s.charAt(i);
			if(c=='1')ans+="9";
			else ans+="1";
		}
		
		System.out.println(Integer.parseInt(ans));
	}
} Main
import java.util.Scanner;

public class Main {

	@SuppressWarnings("resource")
	public static void main(String args[]) {
		Scanner scanner = new Scanner(System.in);
		String s=String.valueOf(scanner.nextInt());
		
		String ans="";
		for(int i=0;i<3;i++) {
			char c=s.charAt(i);
			if(c=='1')ans+="9";
			else ans+="1";
		}
		
		System.out.println(Integer.parseInt(ans));
	}
}