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