import java.util.*;

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

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