import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main{
	public static void main(String[] args) throws IOException {
		try (BufferedReader br = new BufferedReader(
				new InputStreamReader(System.in))) {

			String in = br.readLine();
			String chr[] = in.split("");
			int a = Integer.parseInt(chr[0]);
			int b = Integer.parseInt(chr[1]);
			int c = Integer.parseInt(chr[2]);
			a = (a==1?9:1);
			b = (b==1?9:1);
			c = (c==1?9:1);
			 System.out.println(a*100+b*10+c);
		}
	}
} import java.io.BufferedReader; BufferedReader java.io import java.io.IOException; IOException java.io import java.io.InputStreamReader; InputStreamReader java.io public class Main{
	public static void main(String[] args) throws IOException {
		try (BufferedReader br = new BufferedReader(
				new InputStreamReader(System.in))) {

			String in = br.readLine();
			String chr[] = in.split("");
			int a = Integer.parseInt(chr[0]);
			int b = Integer.parseInt(chr[1]);
			int c = Integer.parseInt(chr[2]);
			a = (a==1?9:1);
			b = (b==1?9:1);
			c = (c==1?9:1);
			 System.out.println(a*100+b*10+c);
		}
	}
} Main public static void main(String[] args) throws IOException {
		try (BufferedReader br = new BufferedReader(
				new InputStreamReader(System.in))) {

			String in = br.readLine();
			String chr[] = in.split("");
			int a = Integer.parseInt(chr[0]);
			int b = Integer.parseInt(chr[1]);
			int c = Integer.parseInt(chr[2]);
			a = (a==1?9:1);
			b = (b==1?9:1);
			c = (c==1?9:1);
			 System.out.println(a*100+b*10+c);
		}
	} main {
		try (BufferedReader br = new BufferedReader(
				new InputStreamReader(System.in))) {

			String in = br.readLine();
			String chr[] = in.split("");
			int a = Integer.parseInt(chr[0]);
			int b = Integer.parseInt(chr[1]);
			int c = Integer.parseInt(chr[2]);
			a = (a==1?9:1);
			b = (b==1?9:1);
			c = (c==1?9:1);
			 System.out.println(a*100+b*10+c);
		}
	} try (BufferedReader br = new BufferedReader(
				new InputStreamReader(System.in))) {

			String in = br.readLine();
			String chr[] = in.split("");
			int a = Integer.parseInt(chr[0]);
			int b = Integer.parseInt(chr[1]);
			int c = Integer.parseInt(chr[2]);
			a = (a==1?9:1);
			b = (b==1?9:1);
			c = (c==1?9:1);
			 System.out.println(a*100+b*10+c);
		} {

			String in = br.readLine();
			String chr[] = in.split("");
			int a = Integer.parseInt(chr[0]);
			int b = Integer.parseInt(chr[1]);
			int c = Integer.parseInt(chr[2]);
			a = (a==1?9:1);
			b = (b==1?9:1);
			c = (c==1?9:1);
			 System.out.println(a*100+b*10+c);
		} BufferedReader br = new BufferedReader(
				new InputStreamReader(System.in)) BufferedReader br = new BufferedReader(
				new InputStreamReader(System.in)) new BufferedReader(
				new InputStreamReader(System.in)) String in = br.readLine(); in br.readLine() br.readLine br String chr[] = in.split(""); chr in.split("") in.split in "" int a = Integer.parseInt(chr[0]); a Integer.parseInt(chr[0]) Integer.parseInt Integer chr[0] chr 0 int b = Integer.parseInt(chr[1]); b Integer.parseInt(chr[1]) Integer.parseInt Integer chr[1] chr 1 int c = Integer.parseInt(chr[2]); c Integer.parseInt(chr[2]) Integer.parseInt Integer chr[2] chr 2 a = (a==1?9:1) a (a==1?9:1) a==1 a 1 9 1 b = (b==1?9:1) b (b==1?9:1) b==1 b 1 9 1 c = (c==1?9:1) c (c==1?9:1) c==1 c 1 9 1 System.out.println(a*100+b*10+c) System.out.println System.out System System.out a*100+b*10+c a*100+b*10+c a*100 a 100 b*10 b 10 c String[] args args public class Main{
	public static void main(String[] args) throws IOException {
		try (BufferedReader br = new BufferedReader(
				new InputStreamReader(System.in))) {

			String in = br.readLine();
			String chr[] = in.split("");
			int a = Integer.parseInt(chr[0]);
			int b = Integer.parseInt(chr[1]);
			int c = Integer.parseInt(chr[2]);
			a = (a==1?9:1);
			b = (b==1?9:1);
			c = (c==1?9:1);
			 System.out.println(a*100+b*10+c);
		}
	}
} public class Main{
	public static void main(String[] args) throws IOException {
		try (BufferedReader br = new BufferedReader(
				new InputStreamReader(System.in))) {

			String in = br.readLine();
			String chr[] = in.split("");
			int a = Integer.parseInt(chr[0]);
			int b = Integer.parseInt(chr[1]);
			int c = Integer.parseInt(chr[2]);
			a = (a==1?9:1);
			b = (b==1?9:1);
			c = (c==1?9:1);
			 System.out.println(a*100+b*10+c);
		}
	}
} Main
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main{
	public static void main(String[] args) throws IOException {
		try (BufferedReader br = new BufferedReader(
				new InputStreamReader(System.in))) {

			String in = br.readLine();
			String chr[] = in.split("");
			int a = Integer.parseInt(chr[0]);
			int b = Integer.parseInt(chr[1]);
			int c = Integer.parseInt(chr[2]);
			a = (a==1?9:1);
			b = (b==1?9:1);
			c = (c==1?9:1);
			 System.out.println(a*100+b*10+c);
		}
	}
}