import java.util.*;

public class Main {
  public static void main(String[] args) {
	Scanner scanner = new Scanner(System.in);
    String text = scanner.nextLine();
    
    StringBuilder result = new StringBuilder();
    for (int ix = 0; ix < text.length(); ix++) {
      if (text.charAt(ix) == '9') {
        result.append(1);
      } else {
        result.append(9);
      }
    }
    
    System.out.println(result);
  }
} import java.util.*; util.* java public class Main {
  public static void main(String[] args) {
	Scanner scanner = new Scanner(System.in);
    String text = scanner.nextLine();
    
    StringBuilder result = new StringBuilder();
    for (int ix = 0; ix < text.length(); ix++) {
      if (text.charAt(ix) == '9') {
        result.append(1);
      } else {
        result.append(9);
      }
    }
    
    System.out.println(result);
  }
} Main public static void main(String[] args) {
	Scanner scanner = new Scanner(System.in);
    String text = scanner.nextLine();
    
    StringBuilder result = new StringBuilder();
    for (int ix = 0; ix < text.length(); ix++) {
      if (text.charAt(ix) == '9') {
        result.append(1);
      } else {
        result.append(9);
      }
    }
    
    System.out.println(result);
  } main {
	Scanner scanner = new Scanner(System.in);
    String text = scanner.nextLine();
    
    StringBuilder result = new StringBuilder();
    for (int ix = 0; ix < text.length(); ix++) {
      if (text.charAt(ix) == '9') {
        result.append(1);
      } else {
        result.append(9);
      }
    }
    
    System.out.println(result);
  } Scanner scanner = new Scanner(System.in); scanner new Scanner(System.in) String text = scanner.nextLine(); text scanner.nextLine() scanner.nextLine scanner StringBuilder result = new StringBuilder(); result new StringBuilder() for (int ix = 0; ix < text.length(); ix++) {
      if (text.charAt(ix) == '9') {
        result.append(1);
      } else {
        result.append(9);
      }
    } int ix = 0; int ix = 0; ix 0 ix < text.length() ix text.length() text.length text ix++ ix++ ix {
      if (text.charAt(ix) == '9') {
        result.append(1);
      } else {
        result.append(9);
      }
    } {
      if (text.charAt(ix) == '9') {
        result.append(1);
      } else {
        result.append(9);
      }
    } if (text.charAt(ix) == '9') {
        result.append(1);
      } else {
        result.append(9);
      } text.charAt(ix) == '9' text.charAt(ix) text.charAt text ix '9' {
        result.append(1);
      } result.append(1) result.append result 1 {
        result.append(9);
      } result.append(9) result.append result 9 System.out.println(result) System.out.println System.out System System.out result String[] args args public class Main {
  public static void main(String[] args) {
	Scanner scanner = new Scanner(System.in);
    String text = scanner.nextLine();
    
    StringBuilder result = new StringBuilder();
    for (int ix = 0; ix < text.length(); ix++) {
      if (text.charAt(ix) == '9') {
        result.append(1);
      } else {
        result.append(9);
      }
    }
    
    System.out.println(result);
  }
} public class Main {
  public static void main(String[] args) {
	Scanner scanner = new Scanner(System.in);
    String text = scanner.nextLine();
    
    StringBuilder result = new StringBuilder();
    for (int ix = 0; ix < text.length(); ix++) {
      if (text.charAt(ix) == '9') {
        result.append(1);
      } else {
        result.append(9);
      }
    }
    
    System.out.println(result);
  }
} Main
import java.util.*;

public class Main {
  public static void main(String[] args) {
	Scanner scanner = new Scanner(System.in);
    String text = scanner.nextLine();
    
    StringBuilder result = new StringBuilder();
    for (int ix = 0; ix < text.length(); ix++) {
      if (text.charAt(ix) == '9') {
        result.append(1);
      } else {
        result.append(9);
      }
    }
    
    System.out.println(result);
  }
}