import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		String strN = scan.next();
		char[] nArray = strN.toCharArray();
		for (int i=0;i<nArray.length;i++) {
			if (nArray[i] == '1') {
				nArray[i] = '9';
			} else {
				nArray[i] = '1';
			}
		}
		strN="";
		for (char c : nArray) {
			strN+=c;
		}
		System.out.println(strN);
	}
} import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		String strN = scan.next();
		char[] nArray = strN.toCharArray();
		for (int i=0;i<nArray.length;i++) {
			if (nArray[i] == '1') {
				nArray[i] = '9';
			} else {
				nArray[i] = '1';
			}
		}
		strN="";
		for (char c : nArray) {
			strN+=c;
		}
		System.out.println(strN);
	}
} Main public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		String strN = scan.next();
		char[] nArray = strN.toCharArray();
		for (int i=0;i<nArray.length;i++) {
			if (nArray[i] == '1') {
				nArray[i] = '9';
			} else {
				nArray[i] = '1';
			}
		}
		strN="";
		for (char c : nArray) {
			strN+=c;
		}
		System.out.println(strN);
	} main {
		Scanner scan = new Scanner(System.in);
		String strN = scan.next();
		char[] nArray = strN.toCharArray();
		for (int i=0;i<nArray.length;i++) {
			if (nArray[i] == '1') {
				nArray[i] = '9';
			} else {
				nArray[i] = '1';
			}
		}
		strN="";
		for (char c : nArray) {
			strN+=c;
		}
		System.out.println(strN);
	} Scanner scan = new Scanner(System.in); scan new Scanner(System.in) String strN = scan.next(); strN scan.next() scan.next scan char[] nArray = strN.toCharArray(); nArray strN.toCharArray() strN.toCharArray strN for (int i=0;i<nArray.length;i++) {
			if (nArray[i] == '1') {
				nArray[i] = '9';
			} else {
				nArray[i] = '1';
			}
		} int i=0; int i=0; i 0 i<nArray.length i nArray.length nArray nArray.length i++ i++ i {
			if (nArray[i] == '1') {
				nArray[i] = '9';
			} else {
				nArray[i] = '1';
			}
		} {
			if (nArray[i] == '1') {
				nArray[i] = '9';
			} else {
				nArray[i] = '1';
			}
		} if (nArray[i] == '1') {
				nArray[i] = '9';
			} else {
				nArray[i] = '1';
			} nArray[i] == '1' nArray[i] nArray i '1' {
				nArray[i] = '9';
			} nArray[i] = '9' nArray[i] nArray i '9' {
				nArray[i] = '1';
			} nArray[i] = '1' nArray[i] nArray i '1' strN="" strN "" for (char c : nArray) {
			strN+=c;
		} char c nArray {
			strN+=c;
		} {
			strN+=c;
		} strN+=c strN c System.out.println(strN) System.out.println System.out System System.out strN String[] args args public class Main {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		String strN = scan.next();
		char[] nArray = strN.toCharArray();
		for (int i=0;i<nArray.length;i++) {
			if (nArray[i] == '1') {
				nArray[i] = '9';
			} else {
				nArray[i] = '1';
			}
		}
		strN="";
		for (char c : nArray) {
			strN+=c;
		}
		System.out.println(strN);
	}
} public class Main {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		String strN = scan.next();
		char[] nArray = strN.toCharArray();
		for (int i=0;i<nArray.length;i++) {
			if (nArray[i] == '1') {
				nArray[i] = '9';
			} else {
				nArray[i] = '1';
			}
		}
		strN="";
		for (char c : nArray) {
			strN+=c;
		}
		System.out.println(strN);
	}
} Main
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		String strN = scan.next();
		char[] nArray = strN.toCharArray();
		for (int i=0;i<nArray.length;i++) {
			if (nArray[i] == '1') {
				nArray[i] = '9';
			} else {
				nArray[i] = '1';
			}
		}
		strN="";
		for (char c : nArray) {
			strN+=c;
		}
		System.out.println(strN);
	}
}
