
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		
		String num = scan.nextLine();
		String out;
		
        for (int i = 0; i < num.length() ; i++) {
        	char c = num.charAt(i);
        	if(c == '1') {
        		System.out.print("9");
        	} else {
        		System.out.print("1");
        	}
        }
	}
} import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		
		String num = scan.nextLine();
		String out;
		
        for (int i = 0; i < num.length() ; i++) {
        	char c = num.charAt(i);
        	if(c == '1') {
        		System.out.print("9");
        	} else {
        		System.out.print("1");
        	}
        }
	}
} Main public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		
		String num = scan.nextLine();
		String out;
		
        for (int i = 0; i < num.length() ; i++) {
        	char c = num.charAt(i);
        	if(c == '1') {
        		System.out.print("9");
        	} else {
        		System.out.print("1");
        	}
        }
	} main {
		Scanner scan = new Scanner(System.in);
		
		String num = scan.nextLine();
		String out;
		
        for (int i = 0; i < num.length() ; i++) {
        	char c = num.charAt(i);
        	if(c == '1') {
        		System.out.print("9");
        	} else {
        		System.out.print("1");
        	}
        }
	} Scanner scan = new Scanner(System.in); scan new Scanner(System.in) String num = scan.nextLine(); num scan.nextLine() scan.nextLine scan String out; out for (int i = 0; i < num.length() ; i++) {
        	char c = num.charAt(i);
        	if(c == '1') {
        		System.out.print("9");
        	} else {
        		System.out.print("1");
        	}
        } int i = 0; int i = 0; i 0 i < num.length() i num.length() num.length num i++ i++ i {
        	char c = num.charAt(i);
        	if(c == '1') {
        		System.out.print("9");
        	} else {
        		System.out.print("1");
        	}
        } {
        	char c = num.charAt(i);
        	if(c == '1') {
        		System.out.print("9");
        	} else {
        		System.out.print("1");
        	}
        } char c = num.charAt(i); c num.charAt(i) num.charAt num 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" String[] args args public class Main {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		
		String num = scan.nextLine();
		String out;
		
        for (int i = 0; i < num.length() ; i++) {
        	char c = num.charAt(i);
        	if(c == '1') {
        		System.out.print("9");
        	} else {
        		System.out.print("1");
        	}
        }
	}
} public class Main {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		
		String num = scan.nextLine();
		String out;
		
        for (int i = 0; i < num.length() ; i++) {
        	char c = num.charAt(i);
        	if(c == '1') {
        		System.out.print("9");
        	} else {
        		System.out.print("1");
        	}
        }
	}
} Main

import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		
		String num = scan.nextLine();
		String out;
		
        for (int i = 0; i < num.length() ; i++) {
        	char c = num.charAt(i);
        	if(c == '1') {
        		System.out.print("9");
        	} else {
        		System.out.print("1");
        	}
        }
	}
}
