import java.util.Scanner;

/**
 * @author Rimi
 *
 */
public class Main {

	/**
	 * @param args
	 */
	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);

		String n = sc.next();

		String a  = n.substring(0 , 1);
		String b  = n.substring(1 , 2);
		String c  = n.substring(2 , 3);

		if(a.equals("1")) {
			a = "9";
		}else {
			a = "1";
		}
		if(b.equals("1")) {
			b = "9";
		}else {
			b = "1";
		}
		if(c.equals("1")) {
			c = "9";
		}else {
			c = "1";
		}

		System.out.print(a);
		System.out.print(b);
		System.out.print(c);

	}

} import java.util.Scanner; Scanner java.util public class Main {

	/**
	 * @param args
	 */
	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);

		String n = sc.next();

		String a  = n.substring(0 , 1);
		String b  = n.substring(1 , 2);
		String c  = n.substring(2 , 3);

		if(a.equals("1")) {
			a = "9";
		}else {
			a = "1";
		}
		if(b.equals("1")) {
			b = "9";
		}else {
			b = "1";
		}
		if(c.equals("1")) {
			c = "9";
		}else {
			c = "1";
		}

		System.out.print(a);
		System.out.print(b);
		System.out.print(c);

	}

} Main /**
	 * @param args
	 */
	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);

		String n = sc.next();

		String a  = n.substring(0 , 1);
		String b  = n.substring(1 , 2);
		String c  = n.substring(2 , 3);

		if(a.equals("1")) {
			a = "9";
		}else {
			a = "1";
		}
		if(b.equals("1")) {
			b = "9";
		}else {
			b = "1";
		}
		if(c.equals("1")) {
			c = "9";
		}else {
			c = "1";
		}

		System.out.print(a);
		System.out.print(b);
		System.out.print(c);

	} main {

		Scanner sc = new Scanner(System.in);

		String n = sc.next();

		String a  = n.substring(0 , 1);
		String b  = n.substring(1 , 2);
		String c  = n.substring(2 , 3);

		if(a.equals("1")) {
			a = "9";
		}else {
			a = "1";
		}
		if(b.equals("1")) {
			b = "9";
		}else {
			b = "1";
		}
		if(c.equals("1")) {
			c = "9";
		}else {
			c = "1";
		}

		System.out.print(a);
		System.out.print(b);
		System.out.print(c);

	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String n = sc.next(); n sc.next() sc.next sc String a  = n.substring(0 , 1); a n.substring(0 , 1) n.substring n 0 1 String b  = n.substring(1 , 2); b n.substring(1 , 2) n.substring n 1 2 String c  = n.substring(2 , 3); c n.substring(2 , 3) n.substring n 2 3 if(a.equals("1")) {
			a = "9";
		}else {
			a = "1";
		} a.equals("1") a.equals a "1" {
			a = "9";
		} a = "9" a "9" {
			a = "1";
		} a = "1" a "1" if(b.equals("1")) {
			b = "9";
		}else {
			b = "1";
		} b.equals("1") b.equals b "1" {
			b = "9";
		} b = "9" b "9" {
			b = "1";
		} b = "1" b "1" if(c.equals("1")) {
			c = "9";
		}else {
			c = "1";
		} c.equals("1") c.equals c "1" {
			c = "9";
		} c = "9" c "9" {
			c = "1";
		} c = "1" c "1" System.out.print(a) System.out.print System.out System System.out a System.out.print(b) System.out.print System.out System System.out b System.out.print(c) System.out.print System.out System System.out c String[] args args public class Main {

	/**
	 * @param args
	 */
	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);

		String n = sc.next();

		String a  = n.substring(0 , 1);
		String b  = n.substring(1 , 2);
		String c  = n.substring(2 , 3);

		if(a.equals("1")) {
			a = "9";
		}else {
			a = "1";
		}
		if(b.equals("1")) {
			b = "9";
		}else {
			b = "1";
		}
		if(c.equals("1")) {
			c = "9";
		}else {
			c = "1";
		}

		System.out.print(a);
		System.out.print(b);
		System.out.print(c);

	}

} public class Main {

	/**
	 * @param args
	 */
	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);

		String n = sc.next();

		String a  = n.substring(0 , 1);
		String b  = n.substring(1 , 2);
		String c  = n.substring(2 , 3);

		if(a.equals("1")) {
			a = "9";
		}else {
			a = "1";
		}
		if(b.equals("1")) {
			b = "9";
		}else {
			b = "1";
		}
		if(c.equals("1")) {
			c = "9";
		}else {
			c = "1";
		}

		System.out.print(a);
		System.out.print(b);
		System.out.print(c);

	}

} Main
import java.util.Scanner;

/**
 * @author Rimi
 *
 */
public class Main {

	/**
	 * @param args
	 */
	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);

		String n = sc.next();

		String a  = n.substring(0 , 1);
		String b  = n.substring(1 , 2);
		String c  = n.substring(2 , 3);

		if(a.equals("1")) {
			a = "9";
		}else {
			a = "1";
		}
		if(b.equals("1")) {
			b = "9";
		}else {
			b = "1";
		}
		if(c.equals("1")) {
			c = "9";
		}else {
			c = "1";
		}

		System.out.print(a);
		System.out.print(b);
		System.out.print(c);

	}

}