import java.util.*;
public class Main {
	public static void main(String args[]) {
		Scanner scn = new Scanner(System.in);
		char[] val = scn.nextLine().trim().toCharArray();
		String out = "";
		for (char v : val) {
			out = out + "" + (v == '1' ? '9' : '1');
		}
		System.out.println(out);
	}
} import java.util.*; util.* java public class Main {
	public static void main(String args[]) {
		Scanner scn = new Scanner(System.in);
		char[] val = scn.nextLine().trim().toCharArray();
		String out = "";
		for (char v : val) {
			out = out + "" + (v == '1' ? '9' : '1');
		}
		System.out.println(out);
	}
} Main public static void main(String args[]) {
		Scanner scn = new Scanner(System.in);
		char[] val = scn.nextLine().trim().toCharArray();
		String out = "";
		for (char v : val) {
			out = out + "" + (v == '1' ? '9' : '1');
		}
		System.out.println(out);
	} main {
		Scanner scn = new Scanner(System.in);
		char[] val = scn.nextLine().trim().toCharArray();
		String out = "";
		for (char v : val) {
			out = out + "" + (v == '1' ? '9' : '1');
		}
		System.out.println(out);
	} Scanner scn = new Scanner(System.in); scn new Scanner(System.in) char[] val = scn.nextLine().trim().toCharArray(); val scn.nextLine().trim().toCharArray() scn.nextLine().trim().toCharArray scn.nextLine().trim() scn.nextLine().trim scn.nextLine() scn.nextLine scn String out = ""; out "" for (char v : val) {
			out = out + "" + (v == '1' ? '9' : '1');
		} char v val {
			out = out + "" + (v == '1' ? '9' : '1');
		} {
			out = out + "" + (v == '1' ? '9' : '1');
		} out = out + "" + (v == '1' ? '9' : '1') out out + "" + (v == '1' ? '9' : '1') out + "" + (v == '1' ? '9' : '1') out "" (v == '1' ? '9' : '1') v == '1' v '1' '9' '1' System.out.println(out) System.out.println System.out System System.out out String args[] args public class Main {
	public static void main(String args[]) {
		Scanner scn = new Scanner(System.in);
		char[] val = scn.nextLine().trim().toCharArray();
		String out = "";
		for (char v : val) {
			out = out + "" + (v == '1' ? '9' : '1');
		}
		System.out.println(out);
	}
} public class Main {
	public static void main(String args[]) {
		Scanner scn = new Scanner(System.in);
		char[] val = scn.nextLine().trim().toCharArray();
		String out = "";
		for (char v : val) {
			out = out + "" + (v == '1' ? '9' : '1');
		}
		System.out.println(out);
	}
} Main
import java.util.*;
public class Main {
	public static void main(String args[]) {
		Scanner scn = new Scanner(System.in);
		char[] val = scn.nextLine().trim().toCharArray();
		String out = "";
		for (char v : val) {
			out = out + "" + (v == '1' ? '9' : '1');
		}
		System.out.println(out);
	}
}