import java.util.Scanner;
public class Main {
	public static void main(String[] args){
		Scanner in = new java.util.Scanner(System.in);
		int N = in.nextInt();
		
		if(N/100 == 1) {
			System.out.print(9);
		}else {
			System.out.print(1);
		}
		N = N%100;
		if(N/10 == 1) {
			System.out.print(9);
		}else {
			System.out.print(1);
		}
		if(N%10 == 1) {
			System.out.print(9);
		}else {
			System.out.print(1);
		}
		
		
		in.close();
	}
} import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String[] args){
		Scanner in = new java.util.Scanner(System.in);
		int N = in.nextInt();
		
		if(N/100 == 1) {
			System.out.print(9);
		}else {
			System.out.print(1);
		}
		N = N%100;
		if(N/10 == 1) {
			System.out.print(9);
		}else {
			System.out.print(1);
		}
		if(N%10 == 1) {
			System.out.print(9);
		}else {
			System.out.print(1);
		}
		
		
		in.close();
	}
} Main public static void main(String[] args){
		Scanner in = new java.util.Scanner(System.in);
		int N = in.nextInt();
		
		if(N/100 == 1) {
			System.out.print(9);
		}else {
			System.out.print(1);
		}
		N = N%100;
		if(N/10 == 1) {
			System.out.print(9);
		}else {
			System.out.print(1);
		}
		if(N%10 == 1) {
			System.out.print(9);
		}else {
			System.out.print(1);
		}
		
		
		in.close();
	} main {
		Scanner in = new java.util.Scanner(System.in);
		int N = in.nextInt();
		
		if(N/100 == 1) {
			System.out.print(9);
		}else {
			System.out.print(1);
		}
		N = N%100;
		if(N/10 == 1) {
			System.out.print(9);
		}else {
			System.out.print(1);
		}
		if(N%10 == 1) {
			System.out.print(9);
		}else {
			System.out.print(1);
		}
		
		
		in.close();
	} Scanner in = new java.util.Scanner(System.in); in new java.util.Scanner(System.in) int N = in.nextInt(); N in.nextInt() in.nextInt in if(N/100 == 1) {
			System.out.print(9);
		}else {
			System.out.print(1);
		} N/100 == 1 N/100 N 100 1 {
			System.out.print(9);
		} System.out.print(9) System.out.print System.out System System.out 9 {
			System.out.print(1);
		} System.out.print(1) System.out.print System.out System System.out 1 N = N%100 N N%100 N 100 if(N/10 == 1) {
			System.out.print(9);
		}else {
			System.out.print(1);
		} N/10 == 1 N/10 N 10 1 {
			System.out.print(9);
		} System.out.print(9) System.out.print System.out System System.out 9 {
			System.out.print(1);
		} System.out.print(1) System.out.print System.out System System.out 1 if(N%10 == 1) {
			System.out.print(9);
		}else {
			System.out.print(1);
		} N%10 == 1 N%10 N 10 1 {
			System.out.print(9);
		} System.out.print(9) System.out.print System.out System System.out 9 {
			System.out.print(1);
		} System.out.print(1) System.out.print System.out System System.out 1 in.close() in.close in String[] args args public class Main {
	public static void main(String[] args){
		Scanner in = new java.util.Scanner(System.in);
		int N = in.nextInt();
		
		if(N/100 == 1) {
			System.out.print(9);
		}else {
			System.out.print(1);
		}
		N = N%100;
		if(N/10 == 1) {
			System.out.print(9);
		}else {
			System.out.print(1);
		}
		if(N%10 == 1) {
			System.out.print(9);
		}else {
			System.out.print(1);
		}
		
		
		in.close();
	}
} public class Main {
	public static void main(String[] args){
		Scanner in = new java.util.Scanner(System.in);
		int N = in.nextInt();
		
		if(N/100 == 1) {
			System.out.print(9);
		}else {
			System.out.print(1);
		}
		N = N%100;
		if(N/10 == 1) {
			System.out.print(9);
		}else {
			System.out.print(1);
		}
		if(N%10 == 1) {
			System.out.print(9);
		}else {
			System.out.print(1);
		}
		
		
		in.close();
	}
} Main
import java.util.Scanner;
public class Main {
	public static void main(String[] args){
		Scanner in = new java.util.Scanner(System.in);
		int N = in.nextInt();
		
		if(N/100 == 1) {
			System.out.print(9);
		}else {
			System.out.print(1);
		}
		N = N%100;
		if(N/10 == 1) {
			System.out.print(9);
		}else {
			System.out.print(1);
		}
		if(N%10 == 1) {
			System.out.print(9);
		}else {
			System.out.print(1);
		}
		
		
		in.close();
	}
}
