import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		String n = scanner.next();
		char[] chars = n.toCharArray();
		chars[0] = chars[0] == '1' ? '9' : '1';
		chars[1] = chars[1] == '1' ? '9' : '1';
		chars[2] = chars[2] == '1' ? '9' : '1';
		System.out.println(chars);
		scanner.close();
	}
} import java.util.Scanner; Scanner java.util public class Main {

	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		String n = scanner.next();
		char[] chars = n.toCharArray();
		chars[0] = chars[0] == '1' ? '9' : '1';
		chars[1] = chars[1] == '1' ? '9' : '1';
		chars[2] = chars[2] == '1' ? '9' : '1';
		System.out.println(chars);
		scanner.close();
	}
} Main public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		String n = scanner.next();
		char[] chars = n.toCharArray();
		chars[0] = chars[0] == '1' ? '9' : '1';
		chars[1] = chars[1] == '1' ? '9' : '1';
		chars[2] = chars[2] == '1' ? '9' : '1';
		System.out.println(chars);
		scanner.close();
	} main {
		Scanner scanner = new Scanner(System.in);
		String n = scanner.next();
		char[] chars = n.toCharArray();
		chars[0] = chars[0] == '1' ? '9' : '1';
		chars[1] = chars[1] == '1' ? '9' : '1';
		chars[2] = chars[2] == '1' ? '9' : '1';
		System.out.println(chars);
		scanner.close();
	} Scanner scanner = new Scanner(System.in); scanner new Scanner(System.in) String n = scanner.next(); n scanner.next() scanner.next scanner char[] chars = n.toCharArray(); chars n.toCharArray() n.toCharArray n chars[0] = chars[0] == '1' ? '9' : '1' chars[0] chars 0 chars[0] == '1' ? '9' : '1' chars[0] == '1' chars[0] chars 0 '1' '9' '1' chars[1] = chars[1] == '1' ? '9' : '1' chars[1] chars 1 chars[1] == '1' ? '9' : '1' chars[1] == '1' chars[1] chars 1 '1' '9' '1' chars[2] = chars[2] == '1' ? '9' : '1' chars[2] chars 2 chars[2] == '1' ? '9' : '1' chars[2] == '1' chars[2] chars 2 '1' '9' '1' System.out.println(chars) System.out.println System.out System System.out chars scanner.close() scanner.close scanner String[] args args public class Main {

	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		String n = scanner.next();
		char[] chars = n.toCharArray();
		chars[0] = chars[0] == '1' ? '9' : '1';
		chars[1] = chars[1] == '1' ? '9' : '1';
		chars[2] = chars[2] == '1' ? '9' : '1';
		System.out.println(chars);
		scanner.close();
	}
} public class Main {

	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		String n = scanner.next();
		char[] chars = n.toCharArray();
		chars[0] = chars[0] == '1' ? '9' : '1';
		chars[1] = chars[1] == '1' ? '9' : '1';
		chars[2] = chars[2] == '1' ? '9' : '1';
		System.out.println(chars);
		scanner.close();
	}
} Main
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		String n = scanner.next();
		char[] chars = n.toCharArray();
		chars[0] = chars[0] == '1' ? '9' : '1';
		chars[1] = chars[1] == '1' ? '9' : '1';
		chars[2] = chars[2] == '1' ? '9' : '1';
		System.out.println(chars);
		scanner.close();
	}
}