import java.util.*;
import java.io.*;

public class Main {
	
	public static void main(String[] args) throws IOException {
		Scanner sc = new Scanner(System.in);
		char a[] = sc.nextLine().toCharArray();
		for(int i = 0;i<a.length; i++) {
			if(a[i] == '9') a[i] = '1'; 
			else a[i] = '9';
		}
		System.out.println(a);
	}
} import java.util.*; util.* java import java.io.*; io.* java public class Main {
	
	public static void main(String[] args) throws IOException {
		Scanner sc = new Scanner(System.in);
		char a[] = sc.nextLine().toCharArray();
		for(int i = 0;i<a.length; i++) {
			if(a[i] == '9') a[i] = '1'; 
			else a[i] = '9';
		}
		System.out.println(a);
	}
} Main public static void main(String[] args) throws IOException {
		Scanner sc = new Scanner(System.in);
		char a[] = sc.nextLine().toCharArray();
		for(int i = 0;i<a.length; i++) {
			if(a[i] == '9') a[i] = '1'; 
			else a[i] = '9';
		}
		System.out.println(a);
	} main {
		Scanner sc = new Scanner(System.in);
		char a[] = sc.nextLine().toCharArray();
		for(int i = 0;i<a.length; i++) {
			if(a[i] == '9') a[i] = '1'; 
			else a[i] = '9';
		}
		System.out.println(a);
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) char a[] = sc.nextLine().toCharArray(); a sc.nextLine().toCharArray() sc.nextLine().toCharArray sc.nextLine() sc.nextLine sc for(int i = 0;i<a.length; i++) {
			if(a[i] == '9') a[i] = '1'; 
			else a[i] = '9';
		} int i = 0; int i = 0; i 0 i<a.length i a.length a a.length i++ i++ i {
			if(a[i] == '9') a[i] = '1'; 
			else a[i] = '9';
		} {
			if(a[i] == '9') a[i] = '1'; 
			else a[i] = '9';
		} if(a[i] == '9') a[i] = '1'; 
			else a[i] = '9'; a[i] == '9' a[i] a i '9' a[i] = '1' a[i] a i '1' a[i] = '9' a[i] a i '9' System.out.println(a) System.out.println System.out System System.out a String[] args args public class Main {
	
	public static void main(String[] args) throws IOException {
		Scanner sc = new Scanner(System.in);
		char a[] = sc.nextLine().toCharArray();
		for(int i = 0;i<a.length; i++) {
			if(a[i] == '9') a[i] = '1'; 
			else a[i] = '9';
		}
		System.out.println(a);
	}
} public class Main {
	
	public static void main(String[] args) throws IOException {
		Scanner sc = new Scanner(System.in);
		char a[] = sc.nextLine().toCharArray();
		for(int i = 0;i<a.length; i++) {
			if(a[i] == '9') a[i] = '1'; 
			else a[i] = '9';
		}
		System.out.println(a);
	}
} Main
import java.util.*;
import java.io.*;

public class Main {
	
	public static void main(String[] args) throws IOException {
		Scanner sc = new Scanner(System.in);
		char a[] = sc.nextLine().toCharArray();
		for(int i = 0;i<a.length; i++) {
			if(a[i] == '9') a[i] = '1'; 
			else a[i] = '9';
		}
		System.out.println(a);
	}
}