import java.util.*;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String str = sc.nextLine();
		String ans = "";
		for(int i = 0; i < str.length(); i++) {
			char c = str.charAt(i);
			if(c == '9') { c = '1'; }
			else { c = '9'; }
			ans += String.valueOf(c);
		}
		System.out.println(ans);
	}
} import java.util.*; util.* java public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String str = sc.nextLine();
		String ans = "";
		for(int i = 0; i < str.length(); i++) {
			char c = str.charAt(i);
			if(c == '9') { c = '1'; }
			else { c = '9'; }
			ans += String.valueOf(c);
		}
		System.out.println(ans);
	}
} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String str = sc.nextLine();
		String ans = "";
		for(int i = 0; i < str.length(); i++) {
			char c = str.charAt(i);
			if(c == '9') { c = '1'; }
			else { c = '9'; }
			ans += String.valueOf(c);
		}
		System.out.println(ans);
	} main {
		Scanner sc = new Scanner(System.in);
		String str = sc.nextLine();
		String ans = "";
		for(int i = 0; i < str.length(); i++) {
			char c = str.charAt(i);
			if(c == '9') { c = '1'; }
			else { c = '9'; }
			ans += String.valueOf(c);
		}
		System.out.println(ans);
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String str = sc.nextLine(); str sc.nextLine() sc.nextLine sc String ans = ""; ans "" for(int i = 0; i < str.length(); i++) {
			char c = str.charAt(i);
			if(c == '9') { c = '1'; }
			else { c = '9'; }
			ans += String.valueOf(c);
		} int i = 0; int i = 0; i 0 i < str.length() i str.length() str.length str i++ i++ i {
			char c = str.charAt(i);
			if(c == '9') { c = '1'; }
			else { c = '9'; }
			ans += String.valueOf(c);
		} {
			char c = str.charAt(i);
			if(c == '9') { c = '1'; }
			else { c = '9'; }
			ans += String.valueOf(c);
		} char c = str.charAt(i); c str.charAt(i) str.charAt str i if(c == '9') { c = '1'; }
			else { c = '9'; } c == '9' c '9' { c = '1'; } c = '1' c '1' { c = '9'; } c = '9' c '9' ans += String.valueOf(c) ans String.valueOf(c) String.valueOf String c System.out.println(ans) System.out.println System.out System System.out ans String[] args args public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String str = sc.nextLine();
		String ans = "";
		for(int i = 0; i < str.length(); i++) {
			char c = str.charAt(i);
			if(c == '9') { c = '1'; }
			else { c = '9'; }
			ans += String.valueOf(c);
		}
		System.out.println(ans);
	}
} public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String str = sc.nextLine();
		String ans = "";
		for(int i = 0; i < str.length(); i++) {
			char c = str.charAt(i);
			if(c == '9') { c = '1'; }
			else { c = '9'; }
			ans += String.valueOf(c);
		}
		System.out.println(ans);
	}
} Main
import java.util.*;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String str = sc.nextLine();
		String ans = "";
		for(int i = 0; i < str.length(); i++) {
			char c = str.charAt(i);
			if(c == '9') { c = '1'; }
			else { c = '9'; }
			ans += String.valueOf(c);
		}
		System.out.println(ans);
	}
}
