import java.io.*;
import java.util.*;
import java.util.stream.*;

public class Main {
	private static BufferedReader br = null;
	
	public static void main(String[] args) {
		String n = read(1)[0];
		
		for (int i = 0; i < n.length(); i++) {
			System.out.print(n.charAt(i) == '1' ? '9' : '1');
		}
		
		System.out.println();
	}
	
	private static String[] read(int len) {
		List<String> strList = new ArrayList<>();
		
		try {
			if (br == null) {
				br = new BufferedReader(new InputStreamReader(System.in));
			}
			
			for (int i = 0; i < len; i++) {
				strList.add(br.readLine());
			}
		} catch (IOException e) {
		}
		
		return strList.toArray(new String[0]);
	}
	
	private static void close() {
		try {
			if (br != null) {
				br.close();
			}
		} catch (IOException e) {
		}
	}
} import java.io.*; io.* java import java.util.*; util.* java import java.util.stream.*; stream.* java.util public class Main {
	private static BufferedReader br = null;
	
	public static void main(String[] args) {
		String n = read(1)[0];
		
		for (int i = 0; i < n.length(); i++) {
			System.out.print(n.charAt(i) == '1' ? '9' : '1');
		}
		
		System.out.println();
	}
	
	private static String[] read(int len) {
		List<String> strList = new ArrayList<>();
		
		try {
			if (br == null) {
				br = new BufferedReader(new InputStreamReader(System.in));
			}
			
			for (int i = 0; i < len; i++) {
				strList.add(br.readLine());
			}
		} catch (IOException e) {
		}
		
		return strList.toArray(new String[0]);
	}
	
	private static void close() {
		try {
			if (br != null) {
				br.close();
			}
		} catch (IOException e) {
		}
	}
} Main private static BufferedReader br = null; br null public static void main(String[] args) {
		String n = read(1)[0];
		
		for (int i = 0; i < n.length(); i++) {
			System.out.print(n.charAt(i) == '1' ? '9' : '1');
		}
		
		System.out.println();
	} main {
		String n = read(1)[0];
		
		for (int i = 0; i < n.length(); i++) {
			System.out.print(n.charAt(i) == '1' ? '9' : '1');
		}
		
		System.out.println();
	} String n = read(1)[0]; n read(1)[0] read(1) read 1 0 for (int i = 0; i < n.length(); i++) {
			System.out.print(n.charAt(i) == '1' ? '9' : '1');
		} int i = 0; int i = 0; i 0 i < n.length() i n.length() n.length n i++ i++ i {
			System.out.print(n.charAt(i) == '1' ? '9' : '1');
		} {
			System.out.print(n.charAt(i) == '1' ? '9' : '1');
		} System.out.print(n.charAt(i) == '1' ? '9' : '1') System.out.print System.out System System.out n.charAt(i) == '1' ? '9' : '1' n.charAt(i) == '1' n.charAt(i) n.charAt n i '1' '9' '1' System.out.println() System.out.println System.out System System.out String[] args args private static String[] read(int len) {
		List<String> strList = new ArrayList<>();
		
		try {
			if (br == null) {
				br = new BufferedReader(new InputStreamReader(System.in));
			}
			
			for (int i = 0; i < len; i++) {
				strList.add(br.readLine());
			}
		} catch (IOException e) {
		}
		
		return strList.toArray(new String[0]);
	} read {
		List<String> strList = new ArrayList<>();
		
		try {
			if (br == null) {
				br = new BufferedReader(new InputStreamReader(System.in));
			}
			
			for (int i = 0; i < len; i++) {
				strList.add(br.readLine());
			}
		} catch (IOException e) {
		}
		
		return strList.toArray(new String[0]);
	} List<String> strList = new ArrayList<>(); strList new ArrayList<>() try {
			if (br == null) {
				br = new BufferedReader(new InputStreamReader(System.in));
			}
			
			for (int i = 0; i < len; i++) {
				strList.add(br.readLine());
			}
		} catch (IOException e) {
		} catch (IOException e) {
		} IOException e {
		} {
			if (br == null) {
				br = new BufferedReader(new InputStreamReader(System.in));
			}
			
			for (int i = 0; i < len; i++) {
				strList.add(br.readLine());
			}
		} if (br == null) {
				br = new BufferedReader(new InputStreamReader(System.in));
			} br == null br null {
				br = new BufferedReader(new InputStreamReader(System.in));
			} br = new BufferedReader(new InputStreamReader(System.in)) br new BufferedReader(new InputStreamReader(System.in)) for (int i = 0; i < len; i++) {
				strList.add(br.readLine());
			} int i = 0; int i = 0; i 0 i < len i len i++ i++ i {
				strList.add(br.readLine());
			} {
				strList.add(br.readLine());
			} strList.add(br.readLine()) strList.add strList br.readLine() br.readLine br return strList.toArray(new String[0]); strList.toArray(new String[0]) strList.toArray strList new String[0] 0 int len len private static void close() {
		try {
			if (br != null) {
				br.close();
			}
		} catch (IOException e) {
		}
	} close {
		try {
			if (br != null) {
				br.close();
			}
		} catch (IOException e) {
		}
	} try {
			if (br != null) {
				br.close();
			}
		} catch (IOException e) {
		} catch (IOException e) {
		} IOException e {
		} {
			if (br != null) {
				br.close();
			}
		} if (br != null) {
				br.close();
			} br != null br null {
				br.close();
			} br.close() br.close br public class Main {
	private static BufferedReader br = null;
	
	public static void main(String[] args) {
		String n = read(1)[0];
		
		for (int i = 0; i < n.length(); i++) {
			System.out.print(n.charAt(i) == '1' ? '9' : '1');
		}
		
		System.out.println();
	}
	
	private static String[] read(int len) {
		List<String> strList = new ArrayList<>();
		
		try {
			if (br == null) {
				br = new BufferedReader(new InputStreamReader(System.in));
			}
			
			for (int i = 0; i < len; i++) {
				strList.add(br.readLine());
			}
		} catch (IOException e) {
		}
		
		return strList.toArray(new String[0]);
	}
	
	private static void close() {
		try {
			if (br != null) {
				br.close();
			}
		} catch (IOException e) {
		}
	}
} public class Main {
	private static BufferedReader br = null;
	
	public static void main(String[] args) {
		String n = read(1)[0];
		
		for (int i = 0; i < n.length(); i++) {
			System.out.print(n.charAt(i) == '1' ? '9' : '1');
		}
		
		System.out.println();
	}
	
	private static String[] read(int len) {
		List<String> strList = new ArrayList<>();
		
		try {
			if (br == null) {
				br = new BufferedReader(new InputStreamReader(System.in));
			}
			
			for (int i = 0; i < len; i++) {
				strList.add(br.readLine());
			}
		} catch (IOException e) {
		}
		
		return strList.toArray(new String[0]);
	}
	
	private static void close() {
		try {
			if (br != null) {
				br.close();
			}
		} catch (IOException e) {
		}
	}
} Main
import java.io.*;
import java.util.*;
import java.util.stream.*;

public class Main {
	private static BufferedReader br = null;
	
	public static void main(String[] args) {
		String n = read(1)[0];
		
		for (int i = 0; i < n.length(); i++) {
			System.out.print(n.charAt(i) == '1' ? '9' : '1');
		}
		
		System.out.println();
	}
	
	private static String[] read(int len) {
		List<String> strList = new ArrayList<>();
		
		try {
			if (br == null) {
				br = new BufferedReader(new InputStreamReader(System.in));
			}
			
			for (int i = 0; i < len; i++) {
				strList.add(br.readLine());
			}
		} catch (IOException e) {
		}
		
		return strList.toArray(new String[0]);
	}
	
	private static void close() {
		try {
			if (br != null) {
				br.close();
			}
		} catch (IOException e) {
		}
	}
}
