import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Main main = new Main();
        main.solve();
    }
    public void solve() {
        Scanner scan = new Scanner(new BufferedReader(new InputStreamReader(System.in)));
        String s = scan.next();
        char[] d = s.toCharArray();
        for(int i = 0; i < d.length; i++) {
            if (d[i] != '1'  && d[i] != '9') {
                continue;
            }
            d[i] = d[i] == '1' ? '9' : '1';
        }
        System.out.println(d);
    }
} import java.io.BufferedReader; BufferedReader java.io import java.io.InputStreamReader; InputStreamReader java.io import java.util.Scanner; Scanner java.util public class Main {
    public static void main(String[] args) {
        Main main = new Main();
        main.solve();
    }
    public void solve() {
        Scanner scan = new Scanner(new BufferedReader(new InputStreamReader(System.in)));
        String s = scan.next();
        char[] d = s.toCharArray();
        for(int i = 0; i < d.length; i++) {
            if (d[i] != '1'  && d[i] != '9') {
                continue;
            }
            d[i] = d[i] == '1' ? '9' : '1';
        }
        System.out.println(d);
    }
} Main public static void main(String[] args) {
        Main main = new Main();
        main.solve();
    } main {
        Main main = new Main();
        main.solve();
    } Main main = new Main(); main new Main() main.solve() main.solve main String[] args args public void solve() {
        Scanner scan = new Scanner(new BufferedReader(new InputStreamReader(System.in)));
        String s = scan.next();
        char[] d = s.toCharArray();
        for(int i = 0; i < d.length; i++) {
            if (d[i] != '1'  && d[i] != '9') {
                continue;
            }
            d[i] = d[i] == '1' ? '9' : '1';
        }
        System.out.println(d);
    } solve {
        Scanner scan = new Scanner(new BufferedReader(new InputStreamReader(System.in)));
        String s = scan.next();
        char[] d = s.toCharArray();
        for(int i = 0; i < d.length; i++) {
            if (d[i] != '1'  && d[i] != '9') {
                continue;
            }
            d[i] = d[i] == '1' ? '9' : '1';
        }
        System.out.println(d);
    } Scanner scan = new Scanner(new BufferedReader(new InputStreamReader(System.in))); scan new Scanner(new BufferedReader(new InputStreamReader(System.in))) String s = scan.next(); s scan.next() scan.next scan char[] d = s.toCharArray(); d s.toCharArray() s.toCharArray s for(int i = 0; i < d.length; i++) {
            if (d[i] != '1'  && d[i] != '9') {
                continue;
            }
            d[i] = d[i] == '1' ? '9' : '1';
        } int i = 0; int i = 0; i 0 i < d.length i d.length d d.length i++ i++ i {
            if (d[i] != '1'  && d[i] != '9') {
                continue;
            }
            d[i] = d[i] == '1' ? '9' : '1';
        } {
            if (d[i] != '1'  && d[i] != '9') {
                continue;
            }
            d[i] = d[i] == '1' ? '9' : '1';
        } if (d[i] != '1'  && d[i] != '9') {
                continue;
            } d[i] != '1'  && d[i] != '9' d[i] != '1' d[i] d i '1' d[i] != '9' d[i] d i '9' {
                continue;
            } continue; d[i] = d[i] == '1' ? '9' : '1' d[i] d i d[i] == '1' ? '9' : '1' d[i] == '1' d[i] d i '1' '9' '1' System.out.println(d) System.out.println System.out System System.out d public class Main {
    public static void main(String[] args) {
        Main main = new Main();
        main.solve();
    }
    public void solve() {
        Scanner scan = new Scanner(new BufferedReader(new InputStreamReader(System.in)));
        String s = scan.next();
        char[] d = s.toCharArray();
        for(int i = 0; i < d.length; i++) {
            if (d[i] != '1'  && d[i] != '9') {
                continue;
            }
            d[i] = d[i] == '1' ? '9' : '1';
        }
        System.out.println(d);
    }
} public class Main {
    public static void main(String[] args) {
        Main main = new Main();
        main.solve();
    }
    public void solve() {
        Scanner scan = new Scanner(new BufferedReader(new InputStreamReader(System.in)));
        String s = scan.next();
        char[] d = s.toCharArray();
        for(int i = 0; i < d.length; i++) {
            if (d[i] != '1'  && d[i] != '9') {
                continue;
            }
            d[i] = d[i] == '1' ? '9' : '1';
        }
        System.out.println(d);
    }
} Main
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Main main = new Main();
        main.solve();
    }
    public void solve() {
        Scanner scan = new Scanner(new BufferedReader(new InputStreamReader(System.in)));
        String s = scan.next();
        char[] d = s.toCharArray();
        for(int i = 0; i < d.length; i++) {
            if (d[i] != '1'  && d[i] != '9') {
                continue;
            }
            d[i] = d[i] == '1' ? '9' : '1';
        }
        System.out.println(d);
    }
}
