import java.util.Scanner;

class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		String nn = String.valueOf(n);
		int[] nnn = new int[3];
		for (int i = 0; i <= 2; i++) {
			if (nn.charAt(i) == '1') {
				nnn[i] = 9;
			} else {
				nnn[i] = 1;
			}
		}
		for (int i = 0; i <= 2; i++) {
			System.out.print(nnn[i]);
		}
	}
} import java.util.Scanner; Scanner java.util class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		String nn = String.valueOf(n);
		int[] nnn = new int[3];
		for (int i = 0; i <= 2; i++) {
			if (nn.charAt(i) == '1') {
				nnn[i] = 9;
			} else {
				nnn[i] = 1;
			}
		}
		for (int i = 0; i <= 2; i++) {
			System.out.print(nnn[i]);
		}
	}
} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		String nn = String.valueOf(n);
		int[] nnn = new int[3];
		for (int i = 0; i <= 2; i++) {
			if (nn.charAt(i) == '1') {
				nnn[i] = 9;
			} else {
				nnn[i] = 1;
			}
		}
		for (int i = 0; i <= 2; i++) {
			System.out.print(nnn[i]);
		}
	} main {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		String nn = String.valueOf(n);
		int[] nnn = new int[3];
		for (int i = 0; i <= 2; i++) {
			if (nn.charAt(i) == '1') {
				nnn[i] = 9;
			} else {
				nnn[i] = 1;
			}
		}
		for (int i = 0; i <= 2; i++) {
			System.out.print(nnn[i]);
		}
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc String nn = String.valueOf(n); nn String.valueOf(n) String.valueOf String n int[] nnn = new int[3]; nnn new int[3] 3 for (int i = 0; i <= 2; i++) {
			if (nn.charAt(i) == '1') {
				nnn[i] = 9;
			} else {
				nnn[i] = 1;
			}
		} int i = 0; int i = 0; i 0 i <= 2 i 2 i++ i++ i {
			if (nn.charAt(i) == '1') {
				nnn[i] = 9;
			} else {
				nnn[i] = 1;
			}
		} {
			if (nn.charAt(i) == '1') {
				nnn[i] = 9;
			} else {
				nnn[i] = 1;
			}
		} if (nn.charAt(i) == '1') {
				nnn[i] = 9;
			} else {
				nnn[i] = 1;
			} nn.charAt(i) == '1' nn.charAt(i) nn.charAt nn i '1' {
				nnn[i] = 9;
			} nnn[i] = 9 nnn[i] nnn i 9 {
				nnn[i] = 1;
			} nnn[i] = 1 nnn[i] nnn i 1 for (int i = 0; i <= 2; i++) {
			System.out.print(nnn[i]);
		} int i = 0; int i = 0; i 0 i <= 2 i 2 i++ i++ i {
			System.out.print(nnn[i]);
		} {
			System.out.print(nnn[i]);
		} System.out.print(nnn[i]) System.out.print System.out System System.out nnn[i] nnn i String[] args args
import java.util.Scanner;

class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		String nn = String.valueOf(n);
		int[] nnn = new int[3];
		for (int i = 0; i <= 2; i++) {
			if (nn.charAt(i) == '1') {
				nnn[i] = 9;
			} else {
				nnn[i] = 1;
			}
		}
		for (int i = 0; i <= 2; i++) {
			System.out.print(nnn[i]);
		}
	}
}
