import java.util.*;

public class Main {
	public static void main(String[] args){
	     Scanner sc = new Scanner(System.in);
	     int n = sc.nextInt();
	     
	     int n3 = n%10;
	     int n2 = n/10%10;
	     int n1 = n/100;

	     switch(n1){
	     	case 1:
	     	n1 = 9;
	     	break;
	     	case 9:
	     	n1 = 1;
	     	break;
	     }

	     switch(n2){
	     	case 1:
	     	n2 = 9;
	     	break;
	     	case 9:
	     	n2 = 1;
	     	break;
	     }

	     switch(n3){
	     	case 1:
	     	n3 = 9;
	     	break;
	     	case 9:
	     	n3 = 1;
	     	break;
	     }

	     System.out.println(100*n1 + 10*n2 + n3);
	}
} 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 n3 = n%10;
	     int n2 = n/10%10;
	     int n1 = n/100;

	     switch(n1){
	     	case 1:
	     	n1 = 9;
	     	break;
	     	case 9:
	     	n1 = 1;
	     	break;
	     }

	     switch(n2){
	     	case 1:
	     	n2 = 9;
	     	break;
	     	case 9:
	     	n2 = 1;
	     	break;
	     }

	     switch(n3){
	     	case 1:
	     	n3 = 9;
	     	break;
	     	case 9:
	     	n3 = 1;
	     	break;
	     }

	     System.out.println(100*n1 + 10*n2 + n3);
	}
} Main public static void main(String[] args){
	     Scanner sc = new Scanner(System.in);
	     int n = sc.nextInt();
	     
	     int n3 = n%10;
	     int n2 = n/10%10;
	     int n1 = n/100;

	     switch(n1){
	     	case 1:
	     	n1 = 9;
	     	break;
	     	case 9:
	     	n1 = 1;
	     	break;
	     }

	     switch(n2){
	     	case 1:
	     	n2 = 9;
	     	break;
	     	case 9:
	     	n2 = 1;
	     	break;
	     }

	     switch(n3){
	     	case 1:
	     	n3 = 9;
	     	break;
	     	case 9:
	     	n3 = 1;
	     	break;
	     }

	     System.out.println(100*n1 + 10*n2 + n3);
	} main {
	     Scanner sc = new Scanner(System.in);
	     int n = sc.nextInt();
	     
	     int n3 = n%10;
	     int n2 = n/10%10;
	     int n1 = n/100;

	     switch(n1){
	     	case 1:
	     	n1 = 9;
	     	break;
	     	case 9:
	     	n1 = 1;
	     	break;
	     }

	     switch(n2){
	     	case 1:
	     	n2 = 9;
	     	break;
	     	case 9:
	     	n2 = 1;
	     	break;
	     }

	     switch(n3){
	     	case 1:
	     	n3 = 9;
	     	break;
	     	case 9:
	     	n3 = 1;
	     	break;
	     }

	     System.out.println(100*n1 + 10*n2 + n3);
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc int n3 = n%10; n3 n%10 n 10 int n2 = n/10%10; n2 n/10%10 n/10 n 10 10 int n1 = n/100; n1 n/100 n 100 switch(n1){
	     	case 1:
	     	n1 = 9;
	     	break;
	     	case 9:
	     	n1 = 1;
	     	break;
	     } n1 case 1: 1 case 1: n1 = 9 n1 9 break; case 9: 9 case 9: n1 = 1 n1 1 break; switch(n2){
	     	case 1:
	     	n2 = 9;
	     	break;
	     	case 9:
	     	n2 = 1;
	     	break;
	     } n2 case 1: 1 case 1: n2 = 9 n2 9 break; case 9: 9 case 9: n2 = 1 n2 1 break; switch(n3){
	     	case 1:
	     	n3 = 9;
	     	break;
	     	case 9:
	     	n3 = 1;
	     	break;
	     } n3 case 1: 1 case 1: n3 = 9 n3 9 break; case 9: 9 case 9: n3 = 1 n3 1 break; System.out.println(100*n1 + 10*n2 + n3) System.out.println System.out System System.out 100*n1 + 10*n2 + n3 100*n1 + 10*n2 + n3 100*n1 100 n1 10*n2 10 n2 n3 String[] args args public class Main {
	public static void main(String[] args){
	     Scanner sc = new Scanner(System.in);
	     int n = sc.nextInt();
	     
	     int n3 = n%10;
	     int n2 = n/10%10;
	     int n1 = n/100;

	     switch(n1){
	     	case 1:
	     	n1 = 9;
	     	break;
	     	case 9:
	     	n1 = 1;
	     	break;
	     }

	     switch(n2){
	     	case 1:
	     	n2 = 9;
	     	break;
	     	case 9:
	     	n2 = 1;
	     	break;
	     }

	     switch(n3){
	     	case 1:
	     	n3 = 9;
	     	break;
	     	case 9:
	     	n3 = 1;
	     	break;
	     }

	     System.out.println(100*n1 + 10*n2 + n3);
	}
} public class Main {
	public static void main(String[] args){
	     Scanner sc = new Scanner(System.in);
	     int n = sc.nextInt();
	     
	     int n3 = n%10;
	     int n2 = n/10%10;
	     int n1 = n/100;

	     switch(n1){
	     	case 1:
	     	n1 = 9;
	     	break;
	     	case 9:
	     	n1 = 1;
	     	break;
	     }

	     switch(n2){
	     	case 1:
	     	n2 = 9;
	     	break;
	     	case 9:
	     	n2 = 1;
	     	break;
	     }

	     switch(n3){
	     	case 1:
	     	n3 = 9;
	     	break;
	     	case 9:
	     	n3 = 1;
	     	break;
	     }

	     System.out.println(100*n1 + 10*n2 + n3);
	}
} Main
import java.util.*;

public class Main {
	public static void main(String[] args){
	     Scanner sc = new Scanner(System.in);
	     int n = sc.nextInt();
	     
	     int n3 = n%10;
	     int n2 = n/10%10;
	     int n1 = n/100;

	     switch(n1){
	     	case 1:
	     	n1 = 9;
	     	break;
	     	case 9:
	     	n1 = 1;
	     	break;
	     }

	     switch(n2){
	     	case 1:
	     	n2 = 9;
	     	break;
	     	case 9:
	     	n2 = 1;
	     	break;
	     }

	     switch(n3){
	     	case 1:
	     	n3 = 9;
	     	break;
	     	case 9:
	     	n3 = 1;
	     	break;
	     }

	     System.out.println(100*n1 + 10*n2 + n3);
	}
}