import java.util.*;
public class Main {
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int nInt = sc.nextInt();

    String nString = String.valueOf(nInt);
    
    String first = nString.substring(0,1);
    if (first.equals("1")) {
        first = "9";
    } else {
        first = "1";
    }
    
    String second = nString.substring(1,2);
     if (second.equals("1")) {
        second = "9";
    } else {
        second = "1";
    }
    
    String third = nString.substring(2,3);
     if (third.equals("1")) {
        third = "9";
    } else {
        third = "1";
    }
    
    System.out.println(first + second + third);
  }
} import java.util.*; util.* java public class Main {
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int nInt = sc.nextInt();

    String nString = String.valueOf(nInt);
    
    String first = nString.substring(0,1);
    if (first.equals("1")) {
        first = "9";
    } else {
        first = "1";
    }
    
    String second = nString.substring(1,2);
     if (second.equals("1")) {
        second = "9";
    } else {
        second = "1";
    }
    
    String third = nString.substring(2,3);
     if (third.equals("1")) {
        third = "9";
    } else {
        third = "1";
    }
    
    System.out.println(first + second + third);
  }
} Main public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int nInt = sc.nextInt();

    String nString = String.valueOf(nInt);
    
    String first = nString.substring(0,1);
    if (first.equals("1")) {
        first = "9";
    } else {
        first = "1";
    }
    
    String second = nString.substring(1,2);
     if (second.equals("1")) {
        second = "9";
    } else {
        second = "1";
    }
    
    String third = nString.substring(2,3);
     if (third.equals("1")) {
        third = "9";
    } else {
        third = "1";
    }
    
    System.out.println(first + second + third);
  } main {
    Scanner sc = new Scanner(System.in);
    int nInt = sc.nextInt();

    String nString = String.valueOf(nInt);
    
    String first = nString.substring(0,1);
    if (first.equals("1")) {
        first = "9";
    } else {
        first = "1";
    }
    
    String second = nString.substring(1,2);
     if (second.equals("1")) {
        second = "9";
    } else {
        second = "1";
    }
    
    String third = nString.substring(2,3);
     if (third.equals("1")) {
        third = "9";
    } else {
        third = "1";
    }
    
    System.out.println(first + second + third);
  } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int nInt = sc.nextInt(); nInt sc.nextInt() sc.nextInt sc String nString = String.valueOf(nInt); nString String.valueOf(nInt) String.valueOf String nInt String first = nString.substring(0,1); first nString.substring(0,1) nString.substring nString 0 1 if (first.equals("1")) {
        first = "9";
    } else {
        first = "1";
    } first.equals("1") first.equals first "1" {
        first = "9";
    } first = "9" first "9" {
        first = "1";
    } first = "1" first "1" String second = nString.substring(1,2); second nString.substring(1,2) nString.substring nString 1 2 if (second.equals("1")) {
        second = "9";
    } else {
        second = "1";
    } second.equals("1") second.equals second "1" {
        second = "9";
    } second = "9" second "9" {
        second = "1";
    } second = "1" second "1" String third = nString.substring(2,3); third nString.substring(2,3) nString.substring nString 2 3 if (third.equals("1")) {
        third = "9";
    } else {
        third = "1";
    } third.equals("1") third.equals third "1" {
        third = "9";
    } third = "9" third "9" {
        third = "1";
    } third = "1" third "1" System.out.println(first + second + third) System.out.println System.out System System.out first + second + third first + second + third first second third String[] args args public class Main {
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int nInt = sc.nextInt();

    String nString = String.valueOf(nInt);
    
    String first = nString.substring(0,1);
    if (first.equals("1")) {
        first = "9";
    } else {
        first = "1";
    }
    
    String second = nString.substring(1,2);
     if (second.equals("1")) {
        second = "9";
    } else {
        second = "1";
    }
    
    String third = nString.substring(2,3);
     if (third.equals("1")) {
        third = "9";
    } else {
        third = "1";
    }
    
    System.out.println(first + second + third);
  }
} public class Main {
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int nInt = sc.nextInt();

    String nString = String.valueOf(nInt);
    
    String first = nString.substring(0,1);
    if (first.equals("1")) {
        first = "9";
    } else {
        first = "1";
    }
    
    String second = nString.substring(1,2);
     if (second.equals("1")) {
        second = "9";
    } else {
        second = "1";
    }
    
    String third = nString.substring(2,3);
     if (third.equals("1")) {
        third = "9";
    } else {
        third = "1";
    }
    
    System.out.println(first + second + third);
  }
} Main
import java.util.*;
public class Main {
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int nInt = sc.nextInt();

    String nString = String.valueOf(nInt);
    
    String first = nString.substring(0,1);
    if (first.equals("1")) {
        first = "9";
    } else {
        first = "1";
    }
    
    String second = nString.substring(1,2);
     if (second.equals("1")) {
        second = "9";
    } else {
        second = "1";
    }
    
    String third = nString.substring(2,3);
     if (third.equals("1")) {
        third = "9";
    } else {
        third = "1";
    }
    
    System.out.println(first + second + third);
  }
}