import java.util.*;
 
class Main {
    public static void main(String[] args) {
      
        Scanner sc = new Scanner(System.in);
        int x = sc.nextInt();
        int a = x%10;
      	int b = (x/10)%10;
        int c = x/100;
        
         
        if(a==1 || a ==9){
          if(a==1){a = 9;}
          else{a = 1;}
        }
        if(b==1 || b ==9){
          if(b==1){b = 9;}
          else{b = 1;}
        }
        if(c==1 || c ==9){
          if(c==1){c = 9;}
          else{c = 1;}
        }
          
      System.out.print(c);
      System.out.print(b);
      System.out.print(a);
       
    }
} import java.util.*; util.* java class Main {
    public static void main(String[] args) {
      
        Scanner sc = new Scanner(System.in);
        int x = sc.nextInt();
        int a = x%10;
      	int b = (x/10)%10;
        int c = x/100;
        
         
        if(a==1 || a ==9){
          if(a==1){a = 9;}
          else{a = 1;}
        }
        if(b==1 || b ==9){
          if(b==1){b = 9;}
          else{b = 1;}
        }
        if(c==1 || c ==9){
          if(c==1){c = 9;}
          else{c = 1;}
        }
          
      System.out.print(c);
      System.out.print(b);
      System.out.print(a);
       
    }
} Main public static void main(String[] args) {
      
        Scanner sc = new Scanner(System.in);
        int x = sc.nextInt();
        int a = x%10;
      	int b = (x/10)%10;
        int c = x/100;
        
         
        if(a==1 || a ==9){
          if(a==1){a = 9;}
          else{a = 1;}
        }
        if(b==1 || b ==9){
          if(b==1){b = 9;}
          else{b = 1;}
        }
        if(c==1 || c ==9){
          if(c==1){c = 9;}
          else{c = 1;}
        }
          
      System.out.print(c);
      System.out.print(b);
      System.out.print(a);
       
    } main {
      
        Scanner sc = new Scanner(System.in);
        int x = sc.nextInt();
        int a = x%10;
      	int b = (x/10)%10;
        int c = x/100;
        
         
        if(a==1 || a ==9){
          if(a==1){a = 9;}
          else{a = 1;}
        }
        if(b==1 || b ==9){
          if(b==1){b = 9;}
          else{b = 1;}
        }
        if(c==1 || c ==9){
          if(c==1){c = 9;}
          else{c = 1;}
        }
          
      System.out.print(c);
      System.out.print(b);
      System.out.print(a);
       
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int x = sc.nextInt(); x sc.nextInt() sc.nextInt sc int a = x%10; a x%10 x 10 int b = (x/10)%10; b (x/10)%10 (x/10) x 10 10 int c = x/100; c x/100 x 100 if(a==1 || a ==9){
          if(a==1){a = 9;}
          else{a = 1;}
        } a==1 || a ==9 a==1 a 1 a ==9 a 9 {
          if(a==1){a = 9;}
          else{a = 1;}
        } if(a==1){a = 9;}
          else{a = 1;} a==1 a 1 {a = 9;} a = 9 a 9 {a = 1;} a = 1 a 1 if(b==1 || b ==9){
          if(b==1){b = 9;}
          else{b = 1;}
        } b==1 || b ==9 b==1 b 1 b ==9 b 9 {
          if(b==1){b = 9;}
          else{b = 1;}
        } if(b==1){b = 9;}
          else{b = 1;} b==1 b 1 {b = 9;} b = 9 b 9 {b = 1;} b = 1 b 1 if(c==1 || c ==9){
          if(c==1){c = 9;}
          else{c = 1;}
        } c==1 || c ==9 c==1 c 1 c ==9 c 9 {
          if(c==1){c = 9;}
          else{c = 1;}
        } if(c==1){c = 9;}
          else{c = 1;} c==1 c 1 {c = 9;} c = 9 c 9 {c = 1;} c = 1 c 1 System.out.print(c) System.out.print System.out System System.out c System.out.print(b) System.out.print System.out System System.out b System.out.print(a) System.out.print System.out System System.out a String[] args args
import java.util.*;
 
class Main {
    public static void main(String[] args) {
      
        Scanner sc = new Scanner(System.in);
        int x = sc.nextInt();
        int a = x%10;
      	int b = (x/10)%10;
        int c = x/100;
        
         
        if(a==1 || a ==9){
          if(a==1){a = 9;}
          else{a = 1;}
        }
        if(b==1 || b ==9){
          if(b==1){b = 9;}
          else{b = 1;}
        }
        if(c==1 || c ==9){
          if(c==1){c = 9;}
          else{c = 1;}
        }
          
      System.out.print(c);
      System.out.print(b);
      System.out.print(a);
       
    }
}