import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        String[] a = sc.next().split("");
        for (int i = 0; i < a.length; i++) {
            if (a[i].equals("1")) {
                a[i] = "9";
            } else {
                a[i] = "1";
            }
            System.out.print(a[i]);
        }
    }
} import java.util.*; util.* java public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        String[] a = sc.next().split("");
        for (int i = 0; i < a.length; i++) {
            if (a[i].equals("1")) {
                a[i] = "9";
            } else {
                a[i] = "1";
            }
            System.out.print(a[i]);
        }
    }
} Main public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        String[] a = sc.next().split("");
        for (int i = 0; i < a.length; i++) {
            if (a[i].equals("1")) {
                a[i] = "9";
            } else {
                a[i] = "1";
            }
            System.out.print(a[i]);
        }
    } main {
        Scanner sc = new Scanner(System.in);
        String[] a = sc.next().split("");
        for (int i = 0; i < a.length; i++) {
            if (a[i].equals("1")) {
                a[i] = "9";
            } else {
                a[i] = "1";
            }
            System.out.print(a[i]);
        }
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String[] a = sc.next().split(""); a sc.next().split("") sc.next().split sc.next() sc.next sc "" for (int i = 0; i < a.length; i++) {
            if (a[i].equals("1")) {
                a[i] = "9";
            } else {
                a[i] = "1";
            }
            System.out.print(a[i]);
        } int i = 0; int i = 0; i 0 i < a.length i a.length a a.length i++ i++ i {
            if (a[i].equals("1")) {
                a[i] = "9";
            } else {
                a[i] = "1";
            }
            System.out.print(a[i]);
        } {
            if (a[i].equals("1")) {
                a[i] = "9";
            } else {
                a[i] = "1";
            }
            System.out.print(a[i]);
        } if (a[i].equals("1")) {
                a[i] = "9";
            } else {
                a[i] = "1";
            } a[i].equals("1") a[i].equals a[i] a i "1" {
                a[i] = "9";
            } a[i] = "9" a[i] a i "9" {
                a[i] = "1";
            } a[i] = "1" a[i] a i "1" System.out.print(a[i]) System.out.print System.out System System.out a[i] a i String[] args args public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        String[] a = sc.next().split("");
        for (int i = 0; i < a.length; i++) {
            if (a[i].equals("1")) {
                a[i] = "9";
            } else {
                a[i] = "1";
            }
            System.out.print(a[i]);
        }
    }
} public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        String[] a = sc.next().split("");
        for (int i = 0; i < a.length; i++) {
            if (a[i].equals("1")) {
                a[i] = "9";
            } else {
                a[i] = "1";
            }
            System.out.print(a[i]);
        }
    }
} Main
import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        String[] a = sc.next().split("");
        for (int i = 0; i < a.length; i++) {
            if (a[i].equals("1")) {
                a[i] = "9";
            } else {
                a[i] = "1";
            }
            System.out.print(a[i]);
        }
    }
}
