import java.util.*;

class Main {
    public static void main(String args[]) {
        Scanner inp = new Scanner(System.in);
        String ss = inp.next();
        char s[] = ss.toCharArray();
        char ans[] = new char[s.length];
        for (int i = 0; i < s.length; i++) {
            if (s[i] == '1') ans[i] = '9';
            else ans[i] = '1';
        }
        System.out.println(String.valueOf(ans));
        inp.close();
    }
} import java.util.*; util.* java class Main {
    public static void main(String args[]) {
        Scanner inp = new Scanner(System.in);
        String ss = inp.next();
        char s[] = ss.toCharArray();
        char ans[] = new char[s.length];
        for (int i = 0; i < s.length; i++) {
            if (s[i] == '1') ans[i] = '9';
            else ans[i] = '1';
        }
        System.out.println(String.valueOf(ans));
        inp.close();
    }
} Main public static void main(String args[]) {
        Scanner inp = new Scanner(System.in);
        String ss = inp.next();
        char s[] = ss.toCharArray();
        char ans[] = new char[s.length];
        for (int i = 0; i < s.length; i++) {
            if (s[i] == '1') ans[i] = '9';
            else ans[i] = '1';
        }
        System.out.println(String.valueOf(ans));
        inp.close();
    } main {
        Scanner inp = new Scanner(System.in);
        String ss = inp.next();
        char s[] = ss.toCharArray();
        char ans[] = new char[s.length];
        for (int i = 0; i < s.length; i++) {
            if (s[i] == '1') ans[i] = '9';
            else ans[i] = '1';
        }
        System.out.println(String.valueOf(ans));
        inp.close();
    } Scanner inp = new Scanner(System.in); inp new Scanner(System.in) String ss = inp.next(); ss inp.next() inp.next inp char s[] = ss.toCharArray(); s ss.toCharArray() ss.toCharArray ss char ans[] = new char[s.length]; ans new char[s.length] s.length s s.length for (int i = 0; i < s.length; i++) {
            if (s[i] == '1') ans[i] = '9';
            else ans[i] = '1';
        } int i = 0; int i = 0; i 0 i < s.length i s.length s s.length i++ i++ i {
            if (s[i] == '1') ans[i] = '9';
            else ans[i] = '1';
        } {
            if (s[i] == '1') ans[i] = '9';
            else ans[i] = '1';
        } if (s[i] == '1') ans[i] = '9';
            else ans[i] = '1'; s[i] == '1' s[i] s i '1' ans[i] = '9' ans[i] ans i '9' ans[i] = '1' ans[i] ans i '1' System.out.println(String.valueOf(ans)) System.out.println System.out System System.out String.valueOf(ans) String.valueOf String ans inp.close() inp.close inp String args[] args
import java.util.*;

class Main {
    public static void main(String args[]) {
        Scanner inp = new Scanner(System.in);
        String ss = inp.next();
        char s[] = ss.toCharArray();
        char ans[] = new char[s.length];
        for (int i = 0; i < s.length; i++) {
            if (s[i] == '1') ans[i] = '9';
            else ans[i] = '1';
        }
        System.out.println(String.valueOf(ans));
        inp.close();
    }
}
