

import java.util.Scanner;

public class Main {
	public static void main(String args[]) {

		Scanner scan = new Scanner(System.in);
		String num = scan.next();

		String no1= num.substring(0,1);
		String no2 = num.substring(1,2);
		String no3 = num.substring(2,3);
		if(!no1.equals("1")) {
			no1="1";
		}else if(!no1.equals("9")) {
			no1 ="9";
		}

		if(!no2.equals("1")) {
			no2="1";
		}else if(!no2.equals("9")) {
			no2 ="9";
		}

		if(!no3.equals("1")) {
			no3="1";
		}else if(!no3.equals("9")) {
			no3 ="9";
		}


	System.out.println(no1+no2+no3);
	}
} import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String args[]) {

		Scanner scan = new Scanner(System.in);
		String num = scan.next();

		String no1= num.substring(0,1);
		String no2 = num.substring(1,2);
		String no3 = num.substring(2,3);
		if(!no1.equals("1")) {
			no1="1";
		}else if(!no1.equals("9")) {
			no1 ="9";
		}

		if(!no2.equals("1")) {
			no2="1";
		}else if(!no2.equals("9")) {
			no2 ="9";
		}

		if(!no3.equals("1")) {
			no3="1";
		}else if(!no3.equals("9")) {
			no3 ="9";
		}


	System.out.println(no1+no2+no3);
	}
} Main public static void main(String args[]) {

		Scanner scan = new Scanner(System.in);
		String num = scan.next();

		String no1= num.substring(0,1);
		String no2 = num.substring(1,2);
		String no3 = num.substring(2,3);
		if(!no1.equals("1")) {
			no1="1";
		}else if(!no1.equals("9")) {
			no1 ="9";
		}

		if(!no2.equals("1")) {
			no2="1";
		}else if(!no2.equals("9")) {
			no2 ="9";
		}

		if(!no3.equals("1")) {
			no3="1";
		}else if(!no3.equals("9")) {
			no3 ="9";
		}


	System.out.println(no1+no2+no3);
	} main {

		Scanner scan = new Scanner(System.in);
		String num = scan.next();

		String no1= num.substring(0,1);
		String no2 = num.substring(1,2);
		String no3 = num.substring(2,3);
		if(!no1.equals("1")) {
			no1="1";
		}else if(!no1.equals("9")) {
			no1 ="9";
		}

		if(!no2.equals("1")) {
			no2="1";
		}else if(!no2.equals("9")) {
			no2 ="9";
		}

		if(!no3.equals("1")) {
			no3="1";
		}else if(!no3.equals("9")) {
			no3 ="9";
		}


	System.out.println(no1+no2+no3);
	} Scanner scan = new Scanner(System.in); scan new Scanner(System.in) String num = scan.next(); num scan.next() scan.next scan String no1= num.substring(0,1); no1 num.substring(0,1) num.substring num 0 1 String no2 = num.substring(1,2); no2 num.substring(1,2) num.substring num 1 2 String no3 = num.substring(2,3); no3 num.substring(2,3) num.substring num 2 3 if(!no1.equals("1")) {
			no1="1";
		}else if(!no1.equals("9")) {
			no1 ="9";
		} !no1.equals("1") no1.equals("1") no1.equals no1 "1" {
			no1="1";
		} no1="1" no1 "1" if(!no1.equals("9")) {
			no1 ="9";
		} !no1.equals("9") no1.equals("9") no1.equals no1 "9" {
			no1 ="9";
		} no1 ="9" no1 "9" if(!no2.equals("1")) {
			no2="1";
		}else if(!no2.equals("9")) {
			no2 ="9";
		} !no2.equals("1") no2.equals("1") no2.equals no2 "1" {
			no2="1";
		} no2="1" no2 "1" if(!no2.equals("9")) {
			no2 ="9";
		} !no2.equals("9") no2.equals("9") no2.equals no2 "9" {
			no2 ="9";
		} no2 ="9" no2 "9" if(!no3.equals("1")) {
			no3="1";
		}else if(!no3.equals("9")) {
			no3 ="9";
		} !no3.equals("1") no3.equals("1") no3.equals no3 "1" {
			no3="1";
		} no3="1" no3 "1" if(!no3.equals("9")) {
			no3 ="9";
		} !no3.equals("9") no3.equals("9") no3.equals no3 "9" {
			no3 ="9";
		} no3 ="9" no3 "9" System.out.println(no1+no2+no3) System.out.println System.out System System.out no1+no2+no3 no1+no2+no3 no1 no2 no3 String args[] args public class Main {
	public static void main(String args[]) {

		Scanner scan = new Scanner(System.in);
		String num = scan.next();

		String no1= num.substring(0,1);
		String no2 = num.substring(1,2);
		String no3 = num.substring(2,3);
		if(!no1.equals("1")) {
			no1="1";
		}else if(!no1.equals("9")) {
			no1 ="9";
		}

		if(!no2.equals("1")) {
			no2="1";
		}else if(!no2.equals("9")) {
			no2 ="9";
		}

		if(!no3.equals("1")) {
			no3="1";
		}else if(!no3.equals("9")) {
			no3 ="9";
		}


	System.out.println(no1+no2+no3);
	}
} public class Main {
	public static void main(String args[]) {

		Scanner scan = new Scanner(System.in);
		String num = scan.next();

		String no1= num.substring(0,1);
		String no2 = num.substring(1,2);
		String no3 = num.substring(2,3);
		if(!no1.equals("1")) {
			no1="1";
		}else if(!no1.equals("9")) {
			no1 ="9";
		}

		if(!no2.equals("1")) {
			no2="1";
		}else if(!no2.equals("9")) {
			no2 ="9";
		}

		if(!no3.equals("1")) {
			no3="1";
		}else if(!no3.equals("9")) {
			no3 ="9";
		}


	System.out.println(no1+no2+no3);
	}
} Main


import java.util.Scanner;

public class Main {
	public static void main(String args[]) {

		Scanner scan = new Scanner(System.in);
		String num = scan.next();

		String no1= num.substring(0,1);
		String no2 = num.substring(1,2);
		String no3 = num.substring(2,3);
		if(!no1.equals("1")) {
			no1="1";
		}else if(!no1.equals("9")) {
			no1 ="9";
		}

		if(!no2.equals("1")) {
			no2="1";
		}else if(!no2.equals("9")) {
			no2 ="9";
		}

		if(!no3.equals("1")) {
			no3="1";
		}else if(!no3.equals("9")) {
			no3 ="9";
		}


	System.out.println(no1+no2+no3);
	}
}
