import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String n = sc.nextLine();
		char[] c = new char[3];
		c = n.toCharArray();
		for(int i = 0; i < 3; i++) {
			if(c[i] == '1')c[i] = '9';
			else if(c[i] == '9')c[i] = '1';
			System.out.print(c[i]);
		}
	}
} 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.nextLine();
		char[] c = new char[3];
		c = n.toCharArray();
		for(int i = 0; i < 3; i++) {
			if(c[i] == '1')c[i] = '9';
			else if(c[i] == '9')c[i] = '1';
			System.out.print(c[i]);
		}
	}
} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String n = sc.nextLine();
		char[] c = new char[3];
		c = n.toCharArray();
		for(int i = 0; i < 3; i++) {
			if(c[i] == '1')c[i] = '9';
			else if(c[i] == '9')c[i] = '1';
			System.out.print(c[i]);
		}
	} main {
		Scanner sc = new Scanner(System.in);
		String n = sc.nextLine();
		char[] c = new char[3];
		c = n.toCharArray();
		for(int i = 0; i < 3; i++) {
			if(c[i] == '1')c[i] = '9';
			else if(c[i] == '9')c[i] = '1';
			System.out.print(c[i]);
		}
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String n = sc.nextLine(); n sc.nextLine() sc.nextLine sc char[] c = new char[3]; c new char[3] 3 c = n.toCharArray() c n.toCharArray() n.toCharArray n for(int i = 0; i < 3; i++) {
			if(c[i] == '1')c[i] = '9';
			else if(c[i] == '9')c[i] = '1';
			System.out.print(c[i]);
		} int i = 0; int i = 0; i 0 i < 3 i 3 i++ i++ i {
			if(c[i] == '1')c[i] = '9';
			else if(c[i] == '9')c[i] = '1';
			System.out.print(c[i]);
		} {
			if(c[i] == '1')c[i] = '9';
			else if(c[i] == '9')c[i] = '1';
			System.out.print(c[i]);
		} if(c[i] == '1')c[i] = '9';
			else if(c[i] == '9')c[i] = '1'; c[i] == '1' c[i] c i '1' c[i] = '9' c[i] c i '9' if(c[i] == '9')c[i] = '1'; c[i] == '9' c[i] c i '9' c[i] = '1' c[i] c i '1' System.out.print(c[i]) System.out.print System.out System System.out c[i] c i String[] args args public class Main {

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

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String n = sc.nextLine();
		char[] c = new char[3];
		c = n.toCharArray();
		for(int i = 0; i < 3; i++) {
			if(c[i] == '1')c[i] = '9';
			else if(c[i] == '9')c[i] = '1';
			System.out.print(c[i]);
		}
	}
} Main
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String n = sc.nextLine();
		char[] c = new char[3];
		c = n.toCharArray();
		for(int i = 0; i < 3; i++) {
			if(c[i] == '1')c[i] = '9';
			else if(c[i] == '9')c[i] = '1';
			System.out.print(c[i]);
		}
	}
}