import java.util.*;

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

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