import java.util.*;

class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    String a = sc.next(); 
    
    for(int i = 0; i < 3; i++){
      System.out.print(10 - Character.getNumericValue(a.charAt(i)));
    }
  }
} import java.util.*; util.* java class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    String a = sc.next(); 
    
    for(int i = 0; i < 3; i++){
      System.out.print(10 - Character.getNumericValue(a.charAt(i)));
    }
  }
} Main public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    String a = sc.next(); 
    
    for(int i = 0; i < 3; i++){
      System.out.print(10 - Character.getNumericValue(a.charAt(i)));
    }
  } main {
    Scanner sc = new Scanner(System.in);
    String a = sc.next(); 
    
    for(int i = 0; i < 3; i++){
      System.out.print(10 - Character.getNumericValue(a.charAt(i)));
    }
  } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String a = sc.next(); a sc.next() sc.next sc for(int i = 0; i < 3; i++){
      System.out.print(10 - Character.getNumericValue(a.charAt(i)));
    } int i = 0; int i = 0; i 0 i < 3 i 3 i++ i++ i {
      System.out.print(10 - Character.getNumericValue(a.charAt(i)));
    } {
      System.out.print(10 - Character.getNumericValue(a.charAt(i)));
    } System.out.print(10 - Character.getNumericValue(a.charAt(i))) System.out.print System.out System System.out 10 - Character.getNumericValue(a.charAt(i)) 10 Character.getNumericValue(a.charAt(i)) Character.getNumericValue Character a.charAt(i) a.charAt a i String[] args args
import java.util.*;

class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    String a = sc.next(); 
    
    for(int i = 0; i < 3; i++){
      System.out.print(10 - Character.getNumericValue(a.charAt(i)));
    }
  }
}