import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		char[] ary = sc.next().toCharArray();
		for (char c : ary) {
			if(c == '1') System.out.print(9);
			else System.out.print(1);
		}
		System.out.println();
	}
} import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		char[] ary = sc.next().toCharArray();
		for (char c : ary) {
			if(c == '1') System.out.print(9);
			else System.out.print(1);
		}
		System.out.println();
	}
} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		char[] ary = sc.next().toCharArray();
		for (char c : ary) {
			if(c == '1') System.out.print(9);
			else System.out.print(1);
		}
		System.out.println();
	} main {
		Scanner sc = new Scanner(System.in);
		char[] ary = sc.next().toCharArray();
		for (char c : ary) {
			if(c == '1') System.out.print(9);
			else System.out.print(1);
		}
		System.out.println();
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) char[] ary = sc.next().toCharArray(); ary sc.next().toCharArray() sc.next().toCharArray sc.next() sc.next sc for (char c : ary) {
			if(c == '1') System.out.print(9);
			else System.out.print(1);
		} char c ary {
			if(c == '1') System.out.print(9);
			else System.out.print(1);
		} {
			if(c == '1') System.out.print(9);
			else System.out.print(1);
		} if(c == '1') System.out.print(9);
			else System.out.print(1); c == '1' c '1' System.out.print(9) System.out.print System.out System System.out 9 System.out.print(1) System.out.print System.out System System.out 1 System.out.println() System.out.println System.out System System.out String[] args args public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		char[] ary = sc.next().toCharArray();
		for (char c : ary) {
			if(c == '1') System.out.print(9);
			else System.out.print(1);
		}
		System.out.println();
	}
} public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		char[] ary = sc.next().toCharArray();
		for (char c : ary) {
			if(c == '1') System.out.print(9);
			else System.out.print(1);
		}
		System.out.println();
	}
} Main
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		char[] ary = sc.next().toCharArray();
		for (char c : ary) {
			if(c == '1') System.out.print(9);
			else System.out.print(1);
		}
		System.out.println();
	}
}