import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);

		String input = scan.nextLine();
		String replace = "";
		String m;
		for(int i=0; i<input.length(); i++) {
			if(input.charAt(i) == '1') {
				m = "9";
			} else {
				m = "1";
			}
			replace = replace+m;
		}
		System.out.println(replace);
	}
} import java.util.Scanner; Scanner java.util public class Main {

	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);

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

		String input = scan.nextLine();
		String replace = "";
		String m;
		for(int i=0; i<input.length(); i++) {
			if(input.charAt(i) == '1') {
				m = "9";
			} else {
				m = "1";
			}
			replace = replace+m;
		}
		System.out.println(replace);
	} main {
		Scanner scan = new Scanner(System.in);

		String input = scan.nextLine();
		String replace = "";
		String m;
		for(int i=0; i<input.length(); i++) {
			if(input.charAt(i) == '1') {
				m = "9";
			} else {
				m = "1";
			}
			replace = replace+m;
		}
		System.out.println(replace);
	} Scanner scan = new Scanner(System.in); scan new Scanner(System.in) String input = scan.nextLine(); input scan.nextLine() scan.nextLine scan String replace = ""; replace "" String m; m for(int i=0; i<input.length(); i++) {
			if(input.charAt(i) == '1') {
				m = "9";
			} else {
				m = "1";
			}
			replace = replace+m;
		} int i=0; int i=0; i 0 i<input.length() i input.length() input.length input i++ i++ i {
			if(input.charAt(i) == '1') {
				m = "9";
			} else {
				m = "1";
			}
			replace = replace+m;
		} {
			if(input.charAt(i) == '1') {
				m = "9";
			} else {
				m = "1";
			}
			replace = replace+m;
		} if(input.charAt(i) == '1') {
				m = "9";
			} else {
				m = "1";
			} input.charAt(i) == '1' input.charAt(i) input.charAt input i '1' {
				m = "9";
			} m = "9" m "9" {
				m = "1";
			} m = "1" m "1" replace = replace+m replace replace+m replace m System.out.println(replace) System.out.println System.out System System.out replace String[] args args public class Main {

	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);

		String input = scan.nextLine();
		String replace = "";
		String m;
		for(int i=0; i<input.length(); i++) {
			if(input.charAt(i) == '1') {
				m = "9";
			} else {
				m = "1";
			}
			replace = replace+m;
		}
		System.out.println(replace);
	}
} public class Main {

	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);

		String input = scan.nextLine();
		String replace = "";
		String m;
		for(int i=0; i<input.length(); i++) {
			if(input.charAt(i) == '1') {
				m = "9";
			} else {
				m = "1";
			}
			replace = replace+m;
		}
		System.out.println(replace);
	}
} Main
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);

		String input = scan.nextLine();
		String replace = "";
		String m;
		for(int i=0; i<input.length(); i++) {
			if(input.charAt(i) == '1') {
				m = "9";
			} else {
				m = "1";
			}
			replace = replace+m;
		}
		System.out.println(replace);
	}
}