import java.util.*;

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

		Scanner sc=new Scanner(System.in);

		int n=sc.nextInt();
		int a=n/100; //百の位
		int b=n/10-a*10; //十の位
		int c=n-a*100-b*10; //一の位


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


		System.out.println(a+""+b+""+c);

	}
} import java.util.*; util.* java public class Main {
	public static void main(String[] args) {

		Scanner sc=new Scanner(System.in);

		int n=sc.nextInt();
		int a=n/100; //百の位
		int b=n/10-a*10; //十の位
		int c=n-a*100-b*10; //一の位


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


		System.out.println(a+""+b+""+c);

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

		Scanner sc=new Scanner(System.in);

		int n=sc.nextInt();
		int a=n/100; //百の位
		int b=n/10-a*10; //十の位
		int c=n-a*100-b*10; //一の位


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


		System.out.println(a+""+b+""+c);

	} main {

		Scanner sc=new Scanner(System.in);

		int n=sc.nextInt();
		int a=n/100; //百の位
		int b=n/10-a*10; //十の位
		int c=n-a*100-b*10; //一の位


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


		System.out.println(a+""+b+""+c);

	} Scanner sc=new Scanner(System.in); sc new Scanner(System.in) int n=sc.nextInt(); n sc.nextInt() sc.nextInt sc int a=n/100; a n/100 n 100 int b=n/10-a*10; b n/10-a*10 n/10 n 10 a*10 a 10 int c=n-a*100-b*10; c n-a*100-b*10 n-a*100-b*10 n a*100 a 100 b*10 b 10 if(a==9){
			a=1;
		}else{
			a=9;
		} a==9 a 9 {
			a=1;
		} a=1 a 1 {
			a=9;
		} a=9 a 9 if(b==9){
			b=1;
		}else{
			b=9;
		} b==9 b 9 {
			b=1;
		} b=1 b 1 {
			b=9;
		} b=9 b 9 if(c==9){
			c=1;
		}else{
			c=9;
		} c==9 c 9 {
			c=1;
		} c=1 c 1 {
			c=9;
		} c=9 c 9 System.out.println(a+""+b+""+c) System.out.println System.out System System.out a+""+b+""+c "" b a+""+b+""+c a "" b "" c String[] args args public class Main {
	public static void main(String[] args) {

		Scanner sc=new Scanner(System.in);

		int n=sc.nextInt();
		int a=n/100; //百の位
		int b=n/10-a*10; //十の位
		int c=n-a*100-b*10; //一の位


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


		System.out.println(a+""+b+""+c);

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

		Scanner sc=new Scanner(System.in);

		int n=sc.nextInt();
		int a=n/100; //百の位
		int b=n/10-a*10; //十の位
		int c=n-a*100-b*10; //一の位


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


		System.out.println(a+""+b+""+c);

	}
} Main
import java.util.*;

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

		Scanner sc=new Scanner(System.in);

		int n=sc.nextInt();
		int a=n/100; //百の位
		int b=n/10-a*10; //十の位
		int c=n-a*100-b*10; //一の位


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


		System.out.println(a+""+b+""+c);

	}
}
