import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.List;

public class Main {

	public static void main(String[] args) {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int n = 0;
		String s="";
		try {
			s = br.readLine();
			//n = Integer.parseInt(br.readLine());
		} catch (NumberFormatException | IOException e) {
			// TODO 自動生成された catch ブロック
			e.printStackTrace();
		}
		String[] str = new String[3];
		str = s.split("");
		//System.out.println(str[0]);
		List<Integer> ret = new ArrayList<Integer>();

		for(int j = 0; j<3;j++){
			if(str[j].equals("1"))ret.add(9);
			else ret.add(1);
		}

		String ans = String.valueOf(ret.get(0)) + String.valueOf(ret.get(1)) + String.valueOf(ret.get(2));
		System.out.println(ans);



	}
} import java.io.BufferedReader; BufferedReader java.io import java.io.IOException; IOException java.io import java.io.InputStreamReader; InputStreamReader java.io import java.util.ArrayList; ArrayList java.util import java.util.List; List java.util public class Main {

	public static void main(String[] args) {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int n = 0;
		String s="";
		try {
			s = br.readLine();
			//n = Integer.parseInt(br.readLine());
		} catch (NumberFormatException | IOException e) {
			// TODO 自動生成された catch ブロック
			e.printStackTrace();
		}
		String[] str = new String[3];
		str = s.split("");
		//System.out.println(str[0]);
		List<Integer> ret = new ArrayList<Integer>();

		for(int j = 0; j<3;j++){
			if(str[j].equals("1"))ret.add(9);
			else ret.add(1);
		}

		String ans = String.valueOf(ret.get(0)) + String.valueOf(ret.get(1)) + String.valueOf(ret.get(2));
		System.out.println(ans);



	}
} Main public static void main(String[] args) {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int n = 0;
		String s="";
		try {
			s = br.readLine();
			//n = Integer.parseInt(br.readLine());
		} catch (NumberFormatException | IOException e) {
			// TODO 自動生成された catch ブロック
			e.printStackTrace();
		}
		String[] str = new String[3];
		str = s.split("");
		//System.out.println(str[0]);
		List<Integer> ret = new ArrayList<Integer>();

		for(int j = 0; j<3;j++){
			if(str[j].equals("1"))ret.add(9);
			else ret.add(1);
		}

		String ans = String.valueOf(ret.get(0)) + String.valueOf(ret.get(1)) + String.valueOf(ret.get(2));
		System.out.println(ans);



	} main {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int n = 0;
		String s="";
		try {
			s = br.readLine();
			//n = Integer.parseInt(br.readLine());
		} catch (NumberFormatException | IOException e) {
			// TODO 自動生成された catch ブロック
			e.printStackTrace();
		}
		String[] str = new String[3];
		str = s.split("");
		//System.out.println(str[0]);
		List<Integer> ret = new ArrayList<Integer>();

		for(int j = 0; j<3;j++){
			if(str[j].equals("1"))ret.add(9);
			else ret.add(1);
		}

		String ans = String.valueOf(ret.get(0)) + String.valueOf(ret.get(1)) + String.valueOf(ret.get(2));
		System.out.println(ans);



	} BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) int n = 0; n 0 String s=""; s "" try {
			s = br.readLine();
			//n = Integer.parseInt(br.readLine());
		} catch (NumberFormatException | IOException e) {
			// TODO 自動生成された catch ブロック
			e.printStackTrace();
		} catch (NumberFormatException | IOException e) {
			// TODO 自動生成された catch ブロック
			e.printStackTrace();
		} NumberFormatException | IOException e {
			// TODO 自動生成された catch ブロック
			e.printStackTrace();
		} e.printStackTrace() e.printStackTrace e {
			s = br.readLine();
			//n = Integer.parseInt(br.readLine());
		} s = br.readLine() s br.readLine() br.readLine br String[] str = new String[3]; str new String[3] 3 str = s.split("") str s.split("") s.split s "" List<Integer> ret = new ArrayList<Integer>(); ret new ArrayList<Integer>() for(int j = 0; j<3;j++){
			if(str[j].equals("1"))ret.add(9);
			else ret.add(1);
		} int j = 0; int j = 0; j 0 j<3 j 3 j++ j++ j {
			if(str[j].equals("1"))ret.add(9);
			else ret.add(1);
		} {
			if(str[j].equals("1"))ret.add(9);
			else ret.add(1);
		} if(str[j].equals("1"))ret.add(9);
			else ret.add(1); str[j].equals("1") str[j].equals str[j] str j "1" ret.add(9) ret.add ret 9 ret.add(1) ret.add ret 1 String ans = String.valueOf(ret.get(0)) + String.valueOf(ret.get(1)) + String.valueOf(ret.get(2)); ans String.valueOf(ret.get(0)) + String.valueOf(ret.get(1)) + String.valueOf(ret.get(2)) String.valueOf(ret.get(0)) + String.valueOf(ret.get(1)) + String.valueOf(ret.get(2)) String.valueOf(ret.get(0)) String.valueOf String ret.get(0) ret.get ret 0 String.valueOf(ret.get(1)) String.valueOf String ret.get(1) ret.get ret 1 String.valueOf(ret.get(2)) String.valueOf String ret.get(2) ret.get ret 2 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) {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int n = 0;
		String s="";
		try {
			s = br.readLine();
			//n = Integer.parseInt(br.readLine());
		} catch (NumberFormatException | IOException e) {
			// TODO 自動生成された catch ブロック
			e.printStackTrace();
		}
		String[] str = new String[3];
		str = s.split("");
		//System.out.println(str[0]);
		List<Integer> ret = new ArrayList<Integer>();

		for(int j = 0; j<3;j++){
			if(str[j].equals("1"))ret.add(9);
			else ret.add(1);
		}

		String ans = String.valueOf(ret.get(0)) + String.valueOf(ret.get(1)) + String.valueOf(ret.get(2));
		System.out.println(ans);



	}
} public class Main {

	public static void main(String[] args) {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int n = 0;
		String s="";
		try {
			s = br.readLine();
			//n = Integer.parseInt(br.readLine());
		} catch (NumberFormatException | IOException e) {
			// TODO 自動生成された catch ブロック
			e.printStackTrace();
		}
		String[] str = new String[3];
		str = s.split("");
		//System.out.println(str[0]);
		List<Integer> ret = new ArrayList<Integer>();

		for(int j = 0; j<3;j++){
			if(str[j].equals("1"))ret.add(9);
			else ret.add(1);
		}

		String ans = String.valueOf(ret.get(0)) + String.valueOf(ret.get(1)) + String.valueOf(ret.get(2));
		System.out.println(ans);



	}
} Main
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.List;

public class Main {

	public static void main(String[] args) {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int n = 0;
		String s="";
		try {
			s = br.readLine();
			//n = Integer.parseInt(br.readLine());
		} catch (NumberFormatException | IOException e) {
			// TODO 自動生成された catch ブロック
			e.printStackTrace();
		}
		String[] str = new String[3];
		str = s.split("");
		//System.out.println(str[0]);
		List<Integer> ret = new ArrayList<Integer>();

		for(int j = 0; j<3;j++){
			if(str[j].equals("1"))ret.add(9);
			else ret.add(1);
		}

		String ans = String.valueOf(ret.get(0)) + String.valueOf(ret.get(1)) + String.valueOf(ret.get(2));
		System.out.println(ans);



	}
}