

import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner sc = new Scanner(System.in);

		char[] str = sc.next().toCharArray();

		for(int i = 0; i < str.length; i++){
			if(str[i] == '1'){
				str[i] = '9';
			}
			else if(str[i] == '9'){
				str[i] = '1';
			}
		}

		System.out.println(str);
	}

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

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner sc = new Scanner(System.in);

		char[] str = sc.next().toCharArray();

		for(int i = 0; i < str.length; i++){
			if(str[i] == '1'){
				str[i] = '9';
			}
			else if(str[i] == '9'){
				str[i] = '1';
			}
		}

		System.out.println(str);
	}

} Main public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner sc = new Scanner(System.in);

		char[] str = sc.next().toCharArray();

		for(int i = 0; i < str.length; i++){
			if(str[i] == '1'){
				str[i] = '9';
			}
			else if(str[i] == '9'){
				str[i] = '1';
			}
		}

		System.out.println(str);
	} main {
		// TODO Auto-generated method stub
		Scanner sc = new Scanner(System.in);

		char[] str = sc.next().toCharArray();

		for(int i = 0; i < str.length; i++){
			if(str[i] == '1'){
				str[i] = '9';
			}
			else if(str[i] == '9'){
				str[i] = '1';
			}
		}

		System.out.println(str);
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) char[] str = sc.next().toCharArray(); str sc.next().toCharArray() sc.next().toCharArray sc.next() sc.next sc for(int i = 0; i < str.length; i++){
			if(str[i] == '1'){
				str[i] = '9';
			}
			else if(str[i] == '9'){
				str[i] = '1';
			}
		} int i = 0; int i = 0; i 0 i < str.length i str.length str str.length i++ i++ i {
			if(str[i] == '1'){
				str[i] = '9';
			}
			else if(str[i] == '9'){
				str[i] = '1';
			}
		} {
			if(str[i] == '1'){
				str[i] = '9';
			}
			else if(str[i] == '9'){
				str[i] = '1';
			}
		} if(str[i] == '1'){
				str[i] = '9';
			}
			else if(str[i] == '9'){
				str[i] = '1';
			} str[i] == '1' str[i] str i '1' {
				str[i] = '9';
			} str[i] = '9' str[i] str i '9' if(str[i] == '9'){
				str[i] = '1';
			} str[i] == '9' str[i] str i '9' {
				str[i] = '1';
			} str[i] = '1' str[i] str i '1' System.out.println(str) System.out.println System.out System System.out str String[] args args public class Main {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner sc = new Scanner(System.in);

		char[] str = sc.next().toCharArray();

		for(int i = 0; i < str.length; i++){
			if(str[i] == '1'){
				str[i] = '9';
			}
			else if(str[i] == '9'){
				str[i] = '1';
			}
		}

		System.out.println(str);
	}

} public class Main {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner sc = new Scanner(System.in);

		char[] str = sc.next().toCharArray();

		for(int i = 0; i < str.length; i++){
			if(str[i] == '1'){
				str[i] = '9';
			}
			else if(str[i] == '9'){
				str[i] = '1';
			}
		}

		System.out.println(str);
	}

} Main


import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner sc = new Scanner(System.in);

		char[] str = sc.next().toCharArray();

		for(int i = 0; i < str.length; i++){
			if(str[i] == '1'){
				str[i] = '9';
			}
			else if(str[i] == '9'){
				str[i] = '1';
			}
		}

		System.out.println(str);
	}

}
