import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ

		Scanner sc = new Scanner(System.in);
		//入力表示		
		String n = sc.next();
		char[] a = n.toCharArray();

		for (int i = 0; i < 3; i++) {
			if (a[i] == '1') {
				a[i] = '9';
			} else {
				a[i] = '1';
			}
		}
		System.out.println(String.valueOf(a));
	}
} import java.util.Scanner; Scanner java.util public class Main {

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ

		Scanner sc = new Scanner(System.in);
		//入力表示		
		String n = sc.next();
		char[] a = n.toCharArray();

		for (int i = 0; i < 3; i++) {
			if (a[i] == '1') {
				a[i] = '9';
			} else {
				a[i] = '1';
			}
		}
		System.out.println(String.valueOf(a));
	}
} Main public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ

		Scanner sc = new Scanner(System.in);
		//入力表示		
		String n = sc.next();
		char[] a = n.toCharArray();

		for (int i = 0; i < 3; i++) {
			if (a[i] == '1') {
				a[i] = '9';
			} else {
				a[i] = '1';
			}
		}
		System.out.println(String.valueOf(a));
	} main {
		// TODO 自動生成されたメソッド・スタブ

		Scanner sc = new Scanner(System.in);
		//入力表示		
		String n = sc.next();
		char[] a = n.toCharArray();

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

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ

		Scanner sc = new Scanner(System.in);
		//入力表示		
		String n = sc.next();
		char[] a = n.toCharArray();

		for (int i = 0; i < 3; i++) {
			if (a[i] == '1') {
				a[i] = '9';
			} else {
				a[i] = '1';
			}
		}
		System.out.println(String.valueOf(a));
	}
} public class Main {

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ

		Scanner sc = new Scanner(System.in);
		//入力表示		
		String n = sc.next();
		char[] a = n.toCharArray();

		for (int i = 0; i < 3; i++) {
			if (a[i] == '1') {
				a[i] = '9';
			} else {
				a[i] = '1';
			}
		}
		System.out.println(String.valueOf(a));
	}
} Main
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ

		Scanner sc = new Scanner(System.in);
		//入力表示		
		String n = sc.next();
		char[] a = n.toCharArray();

		for (int i = 0; i < 3; i++) {
			if (a[i] == '1') {
				a[i] = '9';
			} else {
				a[i] = '1';
			}
		}
		System.out.println(String.valueOf(a));
	}
}