import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.IOException;

public class Main {
  public static void main(String[] args) throws IOException {
    BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
    String[] str = in.readLine().split("");
    for(int i=0; i<3; i++) {
      if(str[i].equals("1"))
        str[i]="9";
      else
        str[i]="1";
      System.out.print(str[i]);
    }
  }
} import java.io.BufferedReader; BufferedReader java.io import java.io.InputStreamReader; InputStreamReader java.io import java.io.IOException; IOException java.io public class Main {
  public static void main(String[] args) throws IOException {
    BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
    String[] str = in.readLine().split("");
    for(int i=0; i<3; i++) {
      if(str[i].equals("1"))
        str[i]="9";
      else
        str[i]="1";
      System.out.print(str[i]);
    }
  }
} Main public static void main(String[] args) throws IOException {
    BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
    String[] str = in.readLine().split("");
    for(int i=0; i<3; i++) {
      if(str[i].equals("1"))
        str[i]="9";
      else
        str[i]="1";
      System.out.print(str[i]);
    }
  } main {
    BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
    String[] str = in.readLine().split("");
    for(int i=0; i<3; i++) {
      if(str[i].equals("1"))
        str[i]="9";
      else
        str[i]="1";
      System.out.print(str[i]);
    }
  } BufferedReader in = new BufferedReader(new InputStreamReader(System.in)); in new BufferedReader(new InputStreamReader(System.in)) String[] str = in.readLine().split(""); str in.readLine().split("") in.readLine().split in.readLine() in.readLine in "" for(int i=0; i<3; i++) {
      if(str[i].equals("1"))
        str[i]="9";
      else
        str[i]="1";
      System.out.print(str[i]);
    } int i=0; int i=0; i 0 i<3 i 3 i++ i++ i {
      if(str[i].equals("1"))
        str[i]="9";
      else
        str[i]="1";
      System.out.print(str[i]);
    } {
      if(str[i].equals("1"))
        str[i]="9";
      else
        str[i]="1";
      System.out.print(str[i]);
    } if(str[i].equals("1"))
        str[i]="9";
      else
        str[i]="1"; str[i].equals("1") str[i].equals str[i] str i "1" str[i]="9" str[i] str i "9" str[i]="1" str[i] str i "1" System.out.print(str[i]) System.out.print System.out System System.out str[i] str i String[] args args public class Main {
  public static void main(String[] args) throws IOException {
    BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
    String[] str = in.readLine().split("");
    for(int i=0; i<3; i++) {
      if(str[i].equals("1"))
        str[i]="9";
      else
        str[i]="1";
      System.out.print(str[i]);
    }
  }
} public class Main {
  public static void main(String[] args) throws IOException {
    BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
    String[] str = in.readLine().split("");
    for(int i=0; i<3; i++) {
      if(str[i].equals("1"))
        str[i]="9";
      else
        str[i]="1";
      System.out.print(str[i]);
    }
  }
} Main
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.IOException;

public class Main {
  public static void main(String[] args) throws IOException {
    BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
    String[] str = in.readLine().split("");
    for(int i=0; i<3; i++) {
      if(str[i].equals("1"))
        str[i]="9";
      else
        str[i]="1";
      System.out.print(str[i]);
    }
  }
}