import java.util.Scanner;

public class Main {

	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int a[] = new int[3];
		a[0] = n / 100;
		a[1] = (n - n / 100 * 100) / 10;
		a[2] = n % 10;

		for (int i = 0; i < a.length; i++) {
			if (a[i] == 1) {
				a[i] = 9;
			} else {
				a[i] = 1;
			}
		}

		System.out.println(a[0] * 100 + a[1] * 10 + a[2]);

	}
} import java.util.Scanner; Scanner java.util public class Main {

	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int a[] = new int[3];
		a[0] = n / 100;
		a[1] = (n - n / 100 * 100) / 10;
		a[2] = n % 10;

		for (int i = 0; i < a.length; i++) {
			if (a[i] == 1) {
				a[i] = 9;
			} else {
				a[i] = 1;
			}
		}

		System.out.println(a[0] * 100 + a[1] * 10 + a[2]);

	}
} Main public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int a[] = new int[3];
		a[0] = n / 100;
		a[1] = (n - n / 100 * 100) / 10;
		a[2] = n % 10;

		for (int i = 0; i < a.length; i++) {
			if (a[i] == 1) {
				a[i] = 9;
			} else {
				a[i] = 1;
			}
		}

		System.out.println(a[0] * 100 + a[1] * 10 + a[2]);

	} main {

		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int a[] = new int[3];
		a[0] = n / 100;
		a[1] = (n - n / 100 * 100) / 10;
		a[2] = n % 10;

		for (int i = 0; i < a.length; i++) {
			if (a[i] == 1) {
				a[i] = 9;
			} else {
				a[i] = 1;
			}
		}

		System.out.println(a[0] * 100 + a[1] * 10 + a[2]);

	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc int a[] = new int[3]; a new int[3] 3 a[0] = n / 100 a[0] a 0 n / 100 n 100 a[1] = (n - n / 100 * 100) / 10 a[1] a 1 (n - n / 100 * 100) / 10 (n - n / 100 * 100) n n / 100 * 100 n / 100 n 100 100 10 a[2] = n % 10 a[2] a 2 n % 10 n 10 for (int i = 0; i < a.length; i++) {
			if (a[i] == 1) {
				a[i] = 9;
			} else {
				a[i] = 1;
			}
		} int i = 0; int i = 0; i 0 i < a.length i a.length a a.length i++ i++ i {
			if (a[i] == 1) {
				a[i] = 9;
			} else {
				a[i] = 1;
			}
		} {
			if (a[i] == 1) {
				a[i] = 9;
			} else {
				a[i] = 1;
			}
		} if (a[i] == 1) {
				a[i] = 9;
			} else {
				a[i] = 1;
			} a[i] == 1 a[i] a i 1 {
				a[i] = 9;
			} a[i] = 9 a[i] a i 9 {
				a[i] = 1;
			} a[i] = 1 a[i] a i 1 System.out.println(a[0] * 100 + a[1] * 10 + a[2]) System.out.println System.out System System.out a[0] * 100 + a[1] * 10 + a[2] a[0] * 100 + a[1] * 10 + a[2] a[0] * 100 a[0] a 0 100 a[1] * 10 a[1] a 1 10 a[2] a 2 String[] args args public class Main {

	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int a[] = new int[3];
		a[0] = n / 100;
		a[1] = (n - n / 100 * 100) / 10;
		a[2] = n % 10;

		for (int i = 0; i < a.length; i++) {
			if (a[i] == 1) {
				a[i] = 9;
			} else {
				a[i] = 1;
			}
		}

		System.out.println(a[0] * 100 + a[1] * 10 + a[2]);

	}
} public class Main {

	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int a[] = new int[3];
		a[0] = n / 100;
		a[1] = (n - n / 100 * 100) / 10;
		a[2] = n % 10;

		for (int i = 0; i < a.length; i++) {
			if (a[i] == 1) {
				a[i] = 9;
			} else {
				a[i] = 1;
			}
		}

		System.out.println(a[0] * 100 + a[1] * 10 + a[2]);

	}
} Main
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int a[] = new int[3];
		a[0] = n / 100;
		a[1] = (n - n / 100 * 100) / 10;
		a[2] = n % 10;

		for (int i = 0; i < a.length; i++) {
			if (a[i] == 1) {
				a[i] = 9;
			} else {
				a[i] = 1;
			}
		}

		System.out.println(a[0] * 100 + a[1] * 10 + a[2]);

	}
}