import java.util.Scanner;

public class Main {
    public static void main(String args[]) {
        try (Scanner in = new Scanner(System.in)) {
            int n = in.nextInt();
            int trueN = (n / 100 == 1 ? 900 : 100) + ((n % 100) / 10 == 1 ? 90 : 10) + (n % 10 == 1 ? 9 : 1);
            System.out.println(trueN);
        }
    }
} import java.util.Scanner; Scanner java.util public class Main {
    public static void main(String args[]) {
        try (Scanner in = new Scanner(System.in)) {
            int n = in.nextInt();
            int trueN = (n / 100 == 1 ? 900 : 100) + ((n % 100) / 10 == 1 ? 90 : 10) + (n % 10 == 1 ? 9 : 1);
            System.out.println(trueN);
        }
    }
} Main public static void main(String args[]) {
        try (Scanner in = new Scanner(System.in)) {
            int n = in.nextInt();
            int trueN = (n / 100 == 1 ? 900 : 100) + ((n % 100) / 10 == 1 ? 90 : 10) + (n % 10 == 1 ? 9 : 1);
            System.out.println(trueN);
        }
    } main {
        try (Scanner in = new Scanner(System.in)) {
            int n = in.nextInt();
            int trueN = (n / 100 == 1 ? 900 : 100) + ((n % 100) / 10 == 1 ? 90 : 10) + (n % 10 == 1 ? 9 : 1);
            System.out.println(trueN);
        }
    } try (Scanner in = new Scanner(System.in)) {
            int n = in.nextInt();
            int trueN = (n / 100 == 1 ? 900 : 100) + ((n % 100) / 10 == 1 ? 90 : 10) + (n % 10 == 1 ? 9 : 1);
            System.out.println(trueN);
        } {
            int n = in.nextInt();
            int trueN = (n / 100 == 1 ? 900 : 100) + ((n % 100) / 10 == 1 ? 90 : 10) + (n % 10 == 1 ? 9 : 1);
            System.out.println(trueN);
        } Scanner in = new Scanner(System.in) Scanner in = new Scanner(System.in) new Scanner(System.in) int n = in.nextInt(); n in.nextInt() in.nextInt in int trueN = (n / 100 == 1 ? 900 : 100) + ((n % 100) / 10 == 1 ? 90 : 10) + (n % 10 == 1 ? 9 : 1); trueN (n / 100 == 1 ? 900 : 100) + ((n % 100) / 10 == 1 ? 90 : 10) + (n % 10 == 1 ? 9 : 1) (n / 100 == 1 ? 900 : 100) + ((n % 100) / 10 == 1 ? 90 : 10) + (n % 10 == 1 ? 9 : 1) (n / 100 == 1 ? 900 : 100) n / 100 == 1 n / 100 n 100 1 900 100 ((n % 100) / 10 == 1 ? 90 : 10) (n % 100) / 10 == 1 (n % 100) / 10 (n % 100) n 100 10 1 90 10 (n % 10 == 1 ? 9 : 1) n % 10 == 1 n % 10 n 10 1 9 1 System.out.println(trueN) System.out.println System.out System System.out trueN String args[] args public class Main {
    public static void main(String args[]) {
        try (Scanner in = new Scanner(System.in)) {
            int n = in.nextInt();
            int trueN = (n / 100 == 1 ? 900 : 100) + ((n % 100) / 10 == 1 ? 90 : 10) + (n % 10 == 1 ? 9 : 1);
            System.out.println(trueN);
        }
    }
} public class Main {
    public static void main(String args[]) {
        try (Scanner in = new Scanner(System.in)) {
            int n = in.nextInt();
            int trueN = (n / 100 == 1 ? 900 : 100) + ((n % 100) / 10 == 1 ? 90 : 10) + (n % 10 == 1 ? 9 : 1);
            System.out.println(trueN);
        }
    }
} Main
import java.util.Scanner;

public class Main {
    public static void main(String args[]) {
        try (Scanner in = new Scanner(System.in)) {
            int n = in.nextInt();
            int trueN = (n / 100 == 1 ? 900 : 100) + ((n % 100) / 10 == 1 ? 90 : 10) + (n % 10 == 1 ? 9 : 1);
            System.out.println(trueN);
        }
    }
}
