import java.util.Scanner;

class Main {

	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);
		String n = sc.next();
		sc.close();

		char[] c = n.toCharArray();
		for (int i = 0; i < n.length(); i++) {
			if (c[i] == '1')
				c[i] = '9';
			else
				c[i] = '1';

		}

		String s = String.valueOf(c);

		System.out.println(s);

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

	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);
		String n = sc.next();
		sc.close();

		char[] c = n.toCharArray();
		for (int i = 0; i < n.length(); i++) {
			if (c[i] == '1')
				c[i] = '9';
			else
				c[i] = '1';

		}

		String s = String.valueOf(c);

		System.out.println(s);

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

		Scanner sc = new Scanner(System.in);
		String n = sc.next();
		sc.close();

		char[] c = n.toCharArray();
		for (int i = 0; i < n.length(); i++) {
			if (c[i] == '1')
				c[i] = '9';
			else
				c[i] = '1';

		}

		String s = String.valueOf(c);

		System.out.println(s);

	} main {

		Scanner sc = new Scanner(System.in);
		String n = sc.next();
		sc.close();

		char[] c = n.toCharArray();
		for (int i = 0; i < n.length(); i++) {
			if (c[i] == '1')
				c[i] = '9';
			else
				c[i] = '1';

		}

		String s = String.valueOf(c);

		System.out.println(s);

	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String n = sc.next(); n sc.next() sc.next sc sc.close() sc.close sc char[] c = n.toCharArray(); c n.toCharArray() n.toCharArray n for (int i = 0; i < n.length(); i++) {
			if (c[i] == '1')
				c[i] = '9';
			else
				c[i] = '1';

		} int i = 0; int i = 0; i 0 i < n.length() i n.length() n.length n 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' String s = String.valueOf(c); s String.valueOf(c) String.valueOf String c System.out.println(s) System.out.println System.out System System.out s String[] args args
import java.util.Scanner;

class Main {

	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);
		String n = sc.next();
		sc.close();

		char[] c = n.toCharArray();
		for (int i = 0; i < n.length(); i++) {
			if (c[i] == '1')
				c[i] = '9';
			else
				c[i] = '1';

		}

		String s = String.valueOf(c);

		System.out.println(s);

	}
}