import java.util.Scanner;

public class Main{
  public static void main(String[] args){
    String n=new Scanner(System.in).next();
    char[] c=n.toCharArray();
    for(int i=0;i<3;i++){
      switch(c[i]){
        case '1':
          c[i]='9';
          break;
        case '9':
          c[i]='1';
          break;
      }
    }
    System.out.println(String.valueOf(c));
  }
} import java.util.Scanner; Scanner java.util public class Main{
  public static void main(String[] args){
    String n=new Scanner(System.in).next();
    char[] c=n.toCharArray();
    for(int i=0;i<3;i++){
      switch(c[i]){
        case '1':
          c[i]='9';
          break;
        case '9':
          c[i]='1';
          break;
      }
    }
    System.out.println(String.valueOf(c));
  }
} Main public static void main(String[] args){
    String n=new Scanner(System.in).next();
    char[] c=n.toCharArray();
    for(int i=0;i<3;i++){
      switch(c[i]){
        case '1':
          c[i]='9';
          break;
        case '9':
          c[i]='1';
          break;
      }
    }
    System.out.println(String.valueOf(c));
  } main {
    String n=new Scanner(System.in).next();
    char[] c=n.toCharArray();
    for(int i=0;i<3;i++){
      switch(c[i]){
        case '1':
          c[i]='9';
          break;
        case '9':
          c[i]='1';
          break;
      }
    }
    System.out.println(String.valueOf(c));
  } String n=new Scanner(System.in).next(); n new Scanner(System.in).next() new Scanner(System.in).next new Scanner(System.in) char[] c=n.toCharArray(); c n.toCharArray() n.toCharArray n for(int i=0;i<3;i++){
      switch(c[i]){
        case '1':
          c[i]='9';
          break;
        case '9':
          c[i]='1';
          break;
      }
    } int i=0; int i=0; i 0 i<3 i 3 i++ i++ i {
      switch(c[i]){
        case '1':
          c[i]='9';
          break;
        case '9':
          c[i]='1';
          break;
      }
    } {
      switch(c[i]){
        case '1':
          c[i]='9';
          break;
        case '9':
          c[i]='1';
          break;
      }
    } switch(c[i]){
        case '1':
          c[i]='9';
          break;
        case '9':
          c[i]='1';
          break;
      } c[i] c i case '1': '1' case '1': c[i]='9' c[i] c i '9' break; case '9': '9' case '9': c[i]='1' c[i] c i '1' break; System.out.println(String.valueOf(c)) System.out.println System.out System System.out String.valueOf(c) String.valueOf String c String[] args args public class Main{
  public static void main(String[] args){
    String n=new Scanner(System.in).next();
    char[] c=n.toCharArray();
    for(int i=0;i<3;i++){
      switch(c[i]){
        case '1':
          c[i]='9';
          break;
        case '9':
          c[i]='1';
          break;
      }
    }
    System.out.println(String.valueOf(c));
  }
} public class Main{
  public static void main(String[] args){
    String n=new Scanner(System.in).next();
    char[] c=n.toCharArray();
    for(int i=0;i<3;i++){
      switch(c[i]){
        case '1':
          c[i]='9';
          break;
        case '9':
          c[i]='1';
          break;
      }
    }
    System.out.println(String.valueOf(c));
  }
} Main
import java.util.Scanner;

public class Main{
  public static void main(String[] args){
    String n=new Scanner(System.in).next();
    char[] c=n.toCharArray();
    for(int i=0;i<3;i++){
      switch(c[i]){
        case '1':
          c[i]='9';
          break;
        case '9':
          c[i]='1';
          break;
      }
    }
    System.out.println(String.valueOf(c));
  }
}