import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String s = String.valueOf(sc.nextInt());
        String res = "";
        for (int i = 0; i < 3; i++) {
            if (s.charAt(i) == '1') {
                res += "9";
            } else {
                res += "1";
            }
        }
        System.out.println(Integer.parseInt(res));
        sc.close();
    }
} import java.util.Scanner; Scanner java.util public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String s = String.valueOf(sc.nextInt());
        String res = "";
        for (int i = 0; i < 3; i++) {
            if (s.charAt(i) == '1') {
                res += "9";
            } else {
                res += "1";
            }
        }
        System.out.println(Integer.parseInt(res));
        sc.close();
    }
} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String s = String.valueOf(sc.nextInt());
        String res = "";
        for (int i = 0; i < 3; i++) {
            if (s.charAt(i) == '1') {
                res += "9";
            } else {
                res += "1";
            }
        }
        System.out.println(Integer.parseInt(res));
        sc.close();
    } main {
        Scanner sc = new Scanner(System.in);
        String s = String.valueOf(sc.nextInt());
        String res = "";
        for (int i = 0; i < 3; i++) {
            if (s.charAt(i) == '1') {
                res += "9";
            } else {
                res += "1";
            }
        }
        System.out.println(Integer.parseInt(res));
        sc.close();
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String s = String.valueOf(sc.nextInt()); s String.valueOf(sc.nextInt()) String.valueOf String sc.nextInt() sc.nextInt sc String res = ""; res "" for (int i = 0; i < 3; i++) {
            if (s.charAt(i) == '1') {
                res += "9";
            } else {
                res += "1";
            }
        } int i = 0; int i = 0; i 0 i < 3 i 3 i++ i++ i {
            if (s.charAt(i) == '1') {
                res += "9";
            } else {
                res += "1";
            }
        } {
            if (s.charAt(i) == '1') {
                res += "9";
            } else {
                res += "1";
            }
        } if (s.charAt(i) == '1') {
                res += "9";
            } else {
                res += "1";
            } s.charAt(i) == '1' s.charAt(i) s.charAt s i '1' {
                res += "9";
            } res += "9" res "9" {
                res += "1";
            } res += "1" res "1" System.out.println(Integer.parseInt(res)) System.out.println System.out System System.out Integer.parseInt(res) Integer.parseInt Integer res sc.close() sc.close sc String[] args args public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String s = String.valueOf(sc.nextInt());
        String res = "";
        for (int i = 0; i < 3; i++) {
            if (s.charAt(i) == '1') {
                res += "9";
            } else {
                res += "1";
            }
        }
        System.out.println(Integer.parseInt(res));
        sc.close();
    }
} public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String s = String.valueOf(sc.nextInt());
        String res = "";
        for (int i = 0; i < 3; i++) {
            if (s.charAt(i) == '1') {
                res += "9";
            } else {
                res += "1";
            }
        }
        System.out.println(Integer.parseInt(res));
        sc.close();
    }
} Main
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String s = String.valueOf(sc.nextInt());
        String res = "";
        for (int i = 0; i < 3; i++) {
            if (s.charAt(i) == '1') {
                res += "9";
            } else {
                res += "1";
            }
        }
        System.out.println(Integer.parseInt(res));
        sc.close();
    }
}