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

    for (int i = 0; i < data.length(); i++) {
      String num = String.valueOf(data.charAt(i));
      int n = Integer.parseInt(num);
      if (n == 9) {
        answer += "1";
      } else {
        answer += "9";
      }
    }
    System.out.println(answer);
	}
} import java.util.*; util.* java public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int a = sc.nextInt();
    String data = String.valueOf(a);
    String answer = "";

    for (int i = 0; i < data.length(); i++) {
      String num = String.valueOf(data.charAt(i));
      int n = Integer.parseInt(num);
      if (n == 9) {
        answer += "1";
      } else {
        answer += "9";
      }
    }
    System.out.println(answer);
	}
} Main public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int a = sc.nextInt();
    String data = String.valueOf(a);
    String answer = "";

    for (int i = 0; i < data.length(); i++) {
      String num = String.valueOf(data.charAt(i));
      int n = Integer.parseInt(num);
      if (n == 9) {
        answer += "1";
      } else {
        answer += "9";
      }
    }
    System.out.println(answer);
	} main {
		Scanner sc = new Scanner(System.in);
		int a = sc.nextInt();
    String data = String.valueOf(a);
    String answer = "";

    for (int i = 0; i < data.length(); i++) {
      String num = String.valueOf(data.charAt(i));
      int n = Integer.parseInt(num);
      if (n == 9) {
        answer += "1";
      } else {
        answer += "9";
      }
    }
    System.out.println(answer);
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int a = sc.nextInt(); a sc.nextInt() sc.nextInt sc String data = String.valueOf(a); data String.valueOf(a) String.valueOf String a String answer = ""; answer "" for (int i = 0; i < data.length(); i++) {
      String num = String.valueOf(data.charAt(i));
      int n = Integer.parseInt(num);
      if (n == 9) {
        answer += "1";
      } else {
        answer += "9";
      }
    } int i = 0; int i = 0; i 0 i < data.length() i data.length() data.length data i++ i++ i {
      String num = String.valueOf(data.charAt(i));
      int n = Integer.parseInt(num);
      if (n == 9) {
        answer += "1";
      } else {
        answer += "9";
      }
    } {
      String num = String.valueOf(data.charAt(i));
      int n = Integer.parseInt(num);
      if (n == 9) {
        answer += "1";
      } else {
        answer += "9";
      }
    } String num = String.valueOf(data.charAt(i)); num String.valueOf(data.charAt(i)) String.valueOf String data.charAt(i) data.charAt data i int n = Integer.parseInt(num); n Integer.parseInt(num) Integer.parseInt Integer num if (n == 9) {
        answer += "1";
      } else {
        answer += "9";
      } n == 9 n 9 {
        answer += "1";
      } answer += "1" answer "1" {
        answer += "9";
      } answer += "9" answer "9" System.out.println(answer) System.out.println System.out System System.out answer String[] args args public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int a = sc.nextInt();
    String data = String.valueOf(a);
    String answer = "";

    for (int i = 0; i < data.length(); i++) {
      String num = String.valueOf(data.charAt(i));
      int n = Integer.parseInt(num);
      if (n == 9) {
        answer += "1";
      } else {
        answer += "9";
      }
    }
    System.out.println(answer);
	}
} public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int a = sc.nextInt();
    String data = String.valueOf(a);
    String answer = "";

    for (int i = 0; i < data.length(); i++) {
      String num = String.valueOf(data.charAt(i));
      int n = Integer.parseInt(num);
      if (n == 9) {
        answer += "1";
      } else {
        answer += "9";
      }
    }
    System.out.println(answer);
	}
} Main
import java.util.*;
public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int a = sc.nextInt();
    String data = String.valueOf(a);
    String answer = "";

    for (int i = 0; i < data.length(); i++) {
      String num = String.valueOf(data.charAt(i));
      int n = Integer.parseInt(num);
      if (n == 9) {
        answer += "1";
      } else {
        answer += "9";
      }
    }
    System.out.println(answer);
	}
}
