import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String N = sc.next();
		sc.close();
		char[] tmpN = new char[N.length()];
		for(int a = 0 ; a < N.length() ; a++){
			if(N.charAt(a)=='1'){
				tmpN[a] = '9';
			}else{
				tmpN[a] = '1';
			}
		}
		String N2 = new String(tmpN);
		System.out.println(N2);
	}
} import java.util.Scanner; Scanner java.util public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String N = sc.next();
		sc.close();
		char[] tmpN = new char[N.length()];
		for(int a = 0 ; a < N.length() ; a++){
			if(N.charAt(a)=='1'){
				tmpN[a] = '9';
			}else{
				tmpN[a] = '1';
			}
		}
		String N2 = new String(tmpN);
		System.out.println(N2);
	}
} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String N = sc.next();
		sc.close();
		char[] tmpN = new char[N.length()];
		for(int a = 0 ; a < N.length() ; a++){
			if(N.charAt(a)=='1'){
				tmpN[a] = '9';
			}else{
				tmpN[a] = '1';
			}
		}
		String N2 = new String(tmpN);
		System.out.println(N2);
	} main {
		Scanner sc = new Scanner(System.in);
		String N = sc.next();
		sc.close();
		char[] tmpN = new char[N.length()];
		for(int a = 0 ; a < N.length() ; a++){
			if(N.charAt(a)=='1'){
				tmpN[a] = '9';
			}else{
				tmpN[a] = '1';
			}
		}
		String N2 = new String(tmpN);
		System.out.println(N2);
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String N = sc.next(); N sc.next() sc.next sc sc.close() sc.close sc char[] tmpN = new char[N.length()]; tmpN new char[N.length()] N.length() N.length N for(int a = 0 ; a < N.length() ; a++){
			if(N.charAt(a)=='1'){
				tmpN[a] = '9';
			}else{
				tmpN[a] = '1';
			}
		} int a = 0 ; int a = 0 ; a 0 a < N.length() a N.length() N.length N a++ a++ a {
			if(N.charAt(a)=='1'){
				tmpN[a] = '9';
			}else{
				tmpN[a] = '1';
			}
		} {
			if(N.charAt(a)=='1'){
				tmpN[a] = '9';
			}else{
				tmpN[a] = '1';
			}
		} if(N.charAt(a)=='1'){
				tmpN[a] = '9';
			}else{
				tmpN[a] = '1';
			} N.charAt(a)=='1' N.charAt(a) N.charAt N a '1' {
				tmpN[a] = '9';
			} tmpN[a] = '9' tmpN[a] tmpN a '9' {
				tmpN[a] = '1';
			} tmpN[a] = '1' tmpN[a] tmpN a '1' String N2 = new String(tmpN); N2 new String(tmpN) System.out.println(N2) System.out.println System.out System System.out N2 String[] args args public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String N = sc.next();
		sc.close();
		char[] tmpN = new char[N.length()];
		for(int a = 0 ; a < N.length() ; a++){
			if(N.charAt(a)=='1'){
				tmpN[a] = '9';
			}else{
				tmpN[a] = '1';
			}
		}
		String N2 = new String(tmpN);
		System.out.println(N2);
	}
} public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String N = sc.next();
		sc.close();
		char[] tmpN = new char[N.length()];
		for(int a = 0 ; a < N.length() ; a++){
			if(N.charAt(a)=='1'){
				tmpN[a] = '9';
			}else{
				tmpN[a] = '1';
			}
		}
		String N2 = new String(tmpN);
		System.out.println(N2);
	}
} Main
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String N = sc.next();
		sc.close();
		char[] tmpN = new char[N.length()];
		for(int a = 0 ; a < N.length() ; a++){
			if(N.charAt(a)=='1'){
				tmpN[a] = '9';
			}else{
				tmpN[a] = '1';
			}
		}
		String N2 = new String(tmpN);
		System.out.println(N2);
	}
}