import java.util.Scanner;

//ABC111-A

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

		String line1 = sc.nextLine();
		char[] tmp = new char[line1.length()];

		for(int i = 0; i < line1.length(); i++){
			char ch = line1.charAt(i);

			if(ch == '1'){
				tmp[i] = '9';
			}else if(ch == '9'){
				tmp[i] = '1';
			}else{
				//ignore
			}
		}

			System.out.println(tmp);
	}
} import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);

		String line1 = sc.nextLine();
		char[] tmp = new char[line1.length()];

		for(int i = 0; i < line1.length(); i++){
			char ch = line1.charAt(i);

			if(ch == '1'){
				tmp[i] = '9';
			}else if(ch == '9'){
				tmp[i] = '1';
			}else{
				//ignore
			}
		}

			System.out.println(tmp);
	}
} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);

		String line1 = sc.nextLine();
		char[] tmp = new char[line1.length()];

		for(int i = 0; i < line1.length(); i++){
			char ch = line1.charAt(i);

			if(ch == '1'){
				tmp[i] = '9';
			}else if(ch == '9'){
				tmp[i] = '1';
			}else{
				//ignore
			}
		}

			System.out.println(tmp);
	} main {
		Scanner sc = new Scanner(System.in);

		String line1 = sc.nextLine();
		char[] tmp = new char[line1.length()];

		for(int i = 0; i < line1.length(); i++){
			char ch = line1.charAt(i);

			if(ch == '1'){
				tmp[i] = '9';
			}else if(ch == '9'){
				tmp[i] = '1';
			}else{
				//ignore
			}
		}

			System.out.println(tmp);
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String line1 = sc.nextLine(); line1 sc.nextLine() sc.nextLine sc char[] tmp = new char[line1.length()]; tmp new char[line1.length()] line1.length() line1.length line1 for(int i = 0; i < line1.length(); i++){
			char ch = line1.charAt(i);

			if(ch == '1'){
				tmp[i] = '9';
			}else if(ch == '9'){
				tmp[i] = '1';
			}else{
				//ignore
			}
		} int i = 0; int i = 0; i 0 i < line1.length() i line1.length() line1.length line1 i++ i++ i {
			char ch = line1.charAt(i);

			if(ch == '1'){
				tmp[i] = '9';
			}else if(ch == '9'){
				tmp[i] = '1';
			}else{
				//ignore
			}
		} {
			char ch = line1.charAt(i);

			if(ch == '1'){
				tmp[i] = '9';
			}else if(ch == '9'){
				tmp[i] = '1';
			}else{
				//ignore
			}
		} char ch = line1.charAt(i); ch line1.charAt(i) line1.charAt line1 i if(ch == '1'){
				tmp[i] = '9';
			}else if(ch == '9'){
				tmp[i] = '1';
			}else{
				//ignore
			} ch == '1' ch '1' {
				tmp[i] = '9';
			} tmp[i] = '9' tmp[i] tmp i '9' if(ch == '9'){
				tmp[i] = '1';
			}else{
				//ignore
			} ch == '9' ch '9' {
				tmp[i] = '1';
			} tmp[i] = '1' tmp[i] tmp i '1' {
				//ignore
			} System.out.println(tmp) System.out.println System.out System System.out tmp String[] args args public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);

		String line1 = sc.nextLine();
		char[] tmp = new char[line1.length()];

		for(int i = 0; i < line1.length(); i++){
			char ch = line1.charAt(i);

			if(ch == '1'){
				tmp[i] = '9';
			}else if(ch == '9'){
				tmp[i] = '1';
			}else{
				//ignore
			}
		}

			System.out.println(tmp);
	}
} public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);

		String line1 = sc.nextLine();
		char[] tmp = new char[line1.length()];

		for(int i = 0; i < line1.length(); i++){
			char ch = line1.charAt(i);

			if(ch == '1'){
				tmp[i] = '9';
			}else if(ch == '9'){
				tmp[i] = '1';
			}else{
				//ignore
			}
		}

			System.out.println(tmp);
	}
} Main
import java.util.Scanner;

//ABC111-A

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

		String line1 = sc.nextLine();
		char[] tmp = new char[line1.length()];

		for(int i = 0; i < line1.length(); i++){
			char ch = line1.charAt(i);

			if(ch == '1'){
				tmp[i] = '9';
			}else if(ch == '9'){
				tmp[i] = '1';
			}else{
				//ignore
			}
		}

			System.out.println(tmp);
	}
}