import java.util.*;
class Main{
	static Scanner scan = new Scanner(System.in);
	public static void main(String[] argv){
		String s = scan.next();
		char[] c = s.toCharArray();
		for(int i=0;i < c.length;i++){
			if(c[i]=='1')
				c[i] = '9';
			else
				c[i] = '1';
		}
		System.out.println(String.valueOf(c));
	}
} import java.util.*; util.* java class Main{
	static Scanner scan = new Scanner(System.in);
	public static void main(String[] argv){
		String s = scan.next();
		char[] c = s.toCharArray();
		for(int i=0;i < c.length;i++){
			if(c[i]=='1')
				c[i] = '9';
			else
				c[i] = '1';
		}
		System.out.println(String.valueOf(c));
	}
} Main static Scanner scan = new Scanner(System.in); scan new Scanner(System.in) public static void main(String[] argv){
		String s = scan.next();
		char[] c = s.toCharArray();
		for(int i=0;i < c.length;i++){
			if(c[i]=='1')
				c[i] = '9';
			else
				c[i] = '1';
		}
		System.out.println(String.valueOf(c));
	} main {
		String s = scan.next();
		char[] c = s.toCharArray();
		for(int i=0;i < c.length;i++){
			if(c[i]=='1')
				c[i] = '9';
			else
				c[i] = '1';
		}
		System.out.println(String.valueOf(c));
	} String s = scan.next(); s scan.next() scan.next scan char[] c = s.toCharArray(); c s.toCharArray() s.toCharArray s for(int i=0;i < c.length;i++){
			if(c[i]=='1')
				c[i] = '9';
			else
				c[i] = '1';
		} int i=0; int i=0; i 0 i < c.length i c.length c c.length i++ i++ i {
			if(c[i]=='1')
				c[i] = '9';
			else
				c[i] = '1';
		} {
			if(c[i]=='1')
				c[i] = '9';
			else
				c[i] = '1';
		} if(c[i]=='1')
				c[i] = '9';
			else
				c[i] = '1'; c[i]=='1' c[i] c i '1' c[i] = '9' c[i] c i '9' c[i] = '1' c[i] c i '1' System.out.println(String.valueOf(c)) System.out.println System.out System System.out String.valueOf(c) String.valueOf String c String[] argv argv
import java.util.*;
class Main{
	static Scanner scan = new Scanner(System.in);
	public static void main(String[] argv){
		String s = scan.next();
		char[] c = s.toCharArray();
		for(int i=0;i < c.length;i++){
			if(c[i]=='1')
				c[i] = '9';
			else
				c[i] = '1';
		}
		System.out.println(String.valueOf(c));
	}
}