import java.util.Scanner;
import java.util.Arrays;

public class Main{
  public static void main(String[] aegs){
    Scanner sc = new Scanner(System.in);
    String s = sc.next();
    System.out.println(s.replace("9","0").replace("1","9").replace("0","1"));
  }


} import java.util.Scanner; Scanner java.util import java.util.Arrays; Arrays java.util public class Main{
  public static void main(String[] aegs){
    Scanner sc = new Scanner(System.in);
    String s = sc.next();
    System.out.println(s.replace("9","0").replace("1","9").replace("0","1"));
  }


} Main public static void main(String[] aegs){
    Scanner sc = new Scanner(System.in);
    String s = sc.next();
    System.out.println(s.replace("9","0").replace("1","9").replace("0","1"));
  } main {
    Scanner sc = new Scanner(System.in);
    String s = sc.next();
    System.out.println(s.replace("9","0").replace("1","9").replace("0","1"));
  } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String s = sc.next(); s sc.next() sc.next sc System.out.println(s.replace("9","0").replace("1","9").replace("0","1")) System.out.println System.out System System.out s.replace("9","0").replace("1","9").replace("0","1") s.replace("9","0").replace("1","9").replace s.replace("9","0").replace("1","9") s.replace("9","0").replace s.replace("9","0") s.replace s "9" "0" "1" "9" "0" "1" String[] aegs aegs public class Main{
  public static void main(String[] aegs){
    Scanner sc = new Scanner(System.in);
    String s = sc.next();
    System.out.println(s.replace("9","0").replace("1","9").replace("0","1"));
  }


} public class Main{
  public static void main(String[] aegs){
    Scanner sc = new Scanner(System.in);
    String s = sc.next();
    System.out.println(s.replace("9","0").replace("1","9").replace("0","1"));
  }


} Main
import java.util.Scanner;
import java.util.Arrays;

public class Main{
  public static void main(String[] aegs){
    Scanner sc = new Scanner(System.in);
    String s = sc.next();
    System.out.println(s.replace("9","0").replace("1","9").replace("0","1"));
  }


}