import java.util.*;
public class Main{
  public static void main(String args[]){
    Scanner sc = new Scanner(System.in);
    String[] s = sc.next().split("");
    for(int i = 0;i<s.length;i++){
      if(s[i].equals("1"))s[i] = "9";
      else if(s[i].equals("9"))s[i] = "1";
      System.out.print(s[i]);
    }
  } 
} import java.util.*; util.* java public class Main{
  public static void main(String args[]){
    Scanner sc = new Scanner(System.in);
    String[] s = sc.next().split("");
    for(int i = 0;i<s.length;i++){
      if(s[i].equals("1"))s[i] = "9";
      else if(s[i].equals("9"))s[i] = "1";
      System.out.print(s[i]);
    }
  } 
} Main public static void main(String args[]){
    Scanner sc = new Scanner(System.in);
    String[] s = sc.next().split("");
    for(int i = 0;i<s.length;i++){
      if(s[i].equals("1"))s[i] = "9";
      else if(s[i].equals("9"))s[i] = "1";
      System.out.print(s[i]);
    }
  } main {
    Scanner sc = new Scanner(System.in);
    String[] s = sc.next().split("");
    for(int i = 0;i<s.length;i++){
      if(s[i].equals("1"))s[i] = "9";
      else if(s[i].equals("9"))s[i] = "1";
      System.out.print(s[i]);
    }
  } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String[] s = sc.next().split(""); s sc.next().split("") sc.next().split sc.next() sc.next sc "" for(int i = 0;i<s.length;i++){
      if(s[i].equals("1"))s[i] = "9";
      else if(s[i].equals("9"))s[i] = "1";
      System.out.print(s[i]);
    } int i = 0; int i = 0; i 0 i<s.length i s.length s s.length i++ i++ i {
      if(s[i].equals("1"))s[i] = "9";
      else if(s[i].equals("9"))s[i] = "1";
      System.out.print(s[i]);
    } {
      if(s[i].equals("1"))s[i] = "9";
      else if(s[i].equals("9"))s[i] = "1";
      System.out.print(s[i]);
    } if(s[i].equals("1"))s[i] = "9";
      else if(s[i].equals("9"))s[i] = "1"; s[i].equals("1") s[i].equals s[i] s i "1" s[i] = "9" s[i] s i "9" if(s[i].equals("9"))s[i] = "1"; s[i].equals("9") s[i].equals s[i] s i "9" s[i] = "1" s[i] s i "1" System.out.print(s[i]) System.out.print System.out System System.out s[i] s i String args[] args public class Main{
  public static void main(String args[]){
    Scanner sc = new Scanner(System.in);
    String[] s = sc.next().split("");
    for(int i = 0;i<s.length;i++){
      if(s[i].equals("1"))s[i] = "9";
      else if(s[i].equals("9"))s[i] = "1";
      System.out.print(s[i]);
    }
  } 
} public class Main{
  public static void main(String args[]){
    Scanner sc = new Scanner(System.in);
    String[] s = sc.next().split("");
    for(int i = 0;i<s.length;i++){
      if(s[i].equals("1"))s[i] = "9";
      else if(s[i].equals("9"))s[i] = "1";
      System.out.print(s[i]);
    }
  } 
} Main
import java.util.*;
public class Main{
  public static void main(String args[]){
    Scanner sc = new Scanner(System.in);
    String[] s = sc.next().split("");
    for(int i = 0;i<s.length;i++){
      if(s[i].equals("1"))s[i] = "9";
      else if(s[i].equals("9"))s[i] = "1";
      System.out.print(s[i]);
    }
  } 
}