import java.util.Scanner;

/**
 * ABC111A
 */
public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String n = sc.next();
        n = n.replace("1", "a").replace("9", "b").replace("a", "9").replace("b", "1");
        System.out.println(n);
        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 n = sc.next();
        n = n.replace("1", "a").replace("9", "b").replace("a", "9").replace("b", "1");
        System.out.println(n);
        sc.close();
    }
} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String n = sc.next();
        n = n.replace("1", "a").replace("9", "b").replace("a", "9").replace("b", "1");
        System.out.println(n);
        sc.close();
    } main {
        Scanner sc = new Scanner(System.in);
        String n = sc.next();
        n = n.replace("1", "a").replace("9", "b").replace("a", "9").replace("b", "1");
        System.out.println(n);
        sc.close();
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String n = sc.next(); n sc.next() sc.next sc n = n.replace("1", "a").replace("9", "b").replace("a", "9").replace("b", "1") n n.replace("1", "a").replace("9", "b").replace("a", "9").replace("b", "1") n.replace("1", "a").replace("9", "b").replace("a", "9").replace n.replace("1", "a").replace("9", "b").replace("a", "9") n.replace("1", "a").replace("9", "b").replace n.replace("1", "a").replace("9", "b") n.replace("1", "a").replace n.replace("1", "a") n.replace n "1" "a" "9" "b" "a" "9" "b" "1" System.out.println(n) System.out.println System.out System System.out n sc.close() sc.close sc String[] args args public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String n = sc.next();
        n = n.replace("1", "a").replace("9", "b").replace("a", "9").replace("b", "1");
        System.out.println(n);
        sc.close();
    }
} public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String n = sc.next();
        n = n.replace("1", "a").replace("9", "b").replace("a", "9").replace("b", "1");
        System.out.println(n);
        sc.close();
    }
} Main
import java.util.Scanner;

/**
 * ABC111A
 */
public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String n = sc.next();
        n = n.replace("1", "a").replace("9", "b").replace("a", "9").replace("b", "1");
        System.out.println(n);
        sc.close();
    }
}