import java.util.*;
public class Main{
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    String s = sc.next();
    char[] c = new char[3];

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

    for(int i=0 ; i<3 ; i++){
      c[i]=s.charAt(i);
      if(c[i]=='1'){
        c[i]='9';
      }else if(c[i]=='9'){
        c[i]='1';
      }
    }
    for(int i=0 ; i<3 ; i++){
      System.out.print(c[i]);
    }
    System.out.println();
  }
} Main public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    String s = sc.next();
    char[] c = new char[3];

    for(int i=0 ; i<3 ; i++){
      c[i]=s.charAt(i);
      if(c[i]=='1'){
        c[i]='9';
      }else if(c[i]=='9'){
        c[i]='1';
      }
    }
    for(int i=0 ; i<3 ; i++){
      System.out.print(c[i]);
    }
    System.out.println();
  } main {
    Scanner sc = new Scanner(System.in);
    String s = sc.next();
    char[] c = new char[3];

    for(int i=0 ; i<3 ; i++){
      c[i]=s.charAt(i);
      if(c[i]=='1'){
        c[i]='9';
      }else if(c[i]=='9'){
        c[i]='1';
      }
    }
    for(int i=0 ; i<3 ; i++){
      System.out.print(c[i]);
    }
    System.out.println();
  } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String s = sc.next(); s sc.next() sc.next sc char[] c = new char[3]; c new char[3] 3 for(int i=0 ; i<3 ; i++){
      c[i]=s.charAt(i);
      if(c[i]=='1'){
        c[i]='9';
      }else if(c[i]=='9'){
        c[i]='1';
      }
    } int i=0 ; int i=0 ; i 0 i<3 i 3 i++ i++ i {
      c[i]=s.charAt(i);
      if(c[i]=='1'){
        c[i]='9';
      }else if(c[i]=='9'){
        c[i]='1';
      }
    } {
      c[i]=s.charAt(i);
      if(c[i]=='1'){
        c[i]='9';
      }else if(c[i]=='9'){
        c[i]='1';
      }
    } c[i]=s.charAt(i) c[i] c i s.charAt(i) s.charAt s i if(c[i]=='1'){
        c[i]='9';
      }else if(c[i]=='9'){
        c[i]='1';
      } c[i]=='1' c[i] c i '1' {
        c[i]='9';
      } c[i]='9' c[i] c i '9' if(c[i]=='9'){
        c[i]='1';
      } c[i]=='9' c[i] c i '9' {
        c[i]='1';
      } c[i]='1' c[i] c i '1' for(int i=0 ; i<3 ; i++){
      System.out.print(c[i]);
    } int i=0 ; int i=0 ; i 0 i<3 i 3 i++ i++ i {
      System.out.print(c[i]);
    } {
      System.out.print(c[i]);
    } System.out.print(c[i]) System.out.print System.out System System.out c[i] c i System.out.println() System.out.println System.out System System.out String[] args args public class Main{
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    String s = sc.next();
    char[] c = new char[3];

    for(int i=0 ; i<3 ; i++){
      c[i]=s.charAt(i);
      if(c[i]=='1'){
        c[i]='9';
      }else if(c[i]=='9'){
        c[i]='1';
      }
    }
    for(int i=0 ; i<3 ; i++){
      System.out.print(c[i]);
    }
    System.out.println();
  }
} public class Main{
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    String s = sc.next();
    char[] c = new char[3];

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

    for(int i=0 ; i<3 ; i++){
      c[i]=s.charAt(i);
      if(c[i]=='1'){
        c[i]='9';
      }else if(c[i]=='9'){
        c[i]='1';
      }
    }
    for(int i=0 ; i<3 ; i++){
      System.out.print(c[i]);
    }
    System.out.println();
  }
}
