import java.util.Scanner;

public class Main {

	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);
		int a = sc.nextInt();
		String s = String.valueOf(a);
		
		for (int i=0; i<s.length(); i++){
			
			char c = s.charAt(i);
			if (c == '1'){
				System.out.print("9");
			}
			else {
				System.out.print("1");
				
			}
			
		}
		
		System.out.println("");
		
		
		
	}

} import java.util.Scanner; Scanner java.util public class Main {

	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);
		int a = sc.nextInt();
		String s = String.valueOf(a);
		
		for (int i=0; i<s.length(); i++){
			
			char c = s.charAt(i);
			if (c == '1'){
				System.out.print("9");
			}
			else {
				System.out.print("1");
				
			}
			
		}
		
		System.out.println("");
		
		
		
	}

} Main public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);
		int a = sc.nextInt();
		String s = String.valueOf(a);
		
		for (int i=0; i<s.length(); i++){
			
			char c = s.charAt(i);
			if (c == '1'){
				System.out.print("9");
			}
			else {
				System.out.print("1");
				
			}
			
		}
		
		System.out.println("");
		
		
		
	} main {

		Scanner sc = new Scanner(System.in);
		int a = sc.nextInt();
		String s = String.valueOf(a);
		
		for (int i=0; i<s.length(); i++){
			
			char c = s.charAt(i);
			if (c == '1'){
				System.out.print("9");
			}
			else {
				System.out.print("1");
				
			}
			
		}
		
		System.out.println("");
		
		
		
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int a = sc.nextInt(); a sc.nextInt() sc.nextInt sc String s = String.valueOf(a); s String.valueOf(a) String.valueOf String a for (int i=0; i<s.length(); i++){
			
			char c = s.charAt(i);
			if (c == '1'){
				System.out.print("9");
			}
			else {
				System.out.print("1");
				
			}
			
		} int i=0; int i=0; i 0 i<s.length() i s.length() s.length s i++ i++ i {
			
			char c = s.charAt(i);
			if (c == '1'){
				System.out.print("9");
			}
			else {
				System.out.print("1");
				
			}
			
		} {
			
			char c = s.charAt(i);
			if (c == '1'){
				System.out.print("9");
			}
			else {
				System.out.print("1");
				
			}
			
		} char c = s.charAt(i); c s.charAt(i) s.charAt s i 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" System.out.println("") System.out.println System.out System System.out "" String[] args args public class Main {

	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);
		int a = sc.nextInt();
		String s = String.valueOf(a);
		
		for (int i=0; i<s.length(); i++){
			
			char c = s.charAt(i);
			if (c == '1'){
				System.out.print("9");
			}
			else {
				System.out.print("1");
				
			}
			
		}
		
		System.out.println("");
		
		
		
	}

} public class Main {

	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);
		int a = sc.nextInt();
		String s = String.valueOf(a);
		
		for (int i=0; i<s.length(); i++){
			
			char c = s.charAt(i);
			if (c == '1'){
				System.out.print("9");
			}
			else {
				System.out.print("1");
				
			}
			
		}
		
		System.out.println("");
		
		
		
	}

} Main
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);
		int a = sc.nextInt();
		String s = String.valueOf(a);
		
		for (int i=0; i<s.length(); i++){
			
			char c = s.charAt(i);
			if (c == '1'){
				System.out.print("9");
			}
			else {
				System.out.print("1");
				
			}
			
		}
		
		System.out.println("");
		
		
		
	}

}
