import java.util.Scanner;

class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();

        int n100 = n / 100;
        int n10 = (n / 10) % 10;
        int n1 = n % 10;
        System.out.print(10 - n100);
        System.out.print(10 - n10);
        System.out.println(10 - n1);
    }
} import java.util.Scanner; Scanner java.util class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();

        int n100 = n / 100;
        int n10 = (n / 10) % 10;
        int n1 = n % 10;
        System.out.print(10 - n100);
        System.out.print(10 - n10);
        System.out.println(10 - n1);
    }
} Main public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();

        int n100 = n / 100;
        int n10 = (n / 10) % 10;
        int n1 = n % 10;
        System.out.print(10 - n100);
        System.out.print(10 - n10);
        System.out.println(10 - n1);
    } main {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();

        int n100 = n / 100;
        int n10 = (n / 10) % 10;
        int n1 = n % 10;
        System.out.print(10 - n100);
        System.out.print(10 - n10);
        System.out.println(10 - n1);
    } Scanner scanner = new Scanner(System.in); scanner new Scanner(System.in) int n = scanner.nextInt(); n scanner.nextInt() scanner.nextInt scanner int n100 = n / 100; n100 n / 100 n 100 int n10 = (n / 10) % 10; n10 (n / 10) % 10 (n / 10) n 10 10 int n1 = n % 10; n1 n % 10 n 10 System.out.print(10 - n100) System.out.print System.out System System.out 10 - n100 10 n100 System.out.print(10 - n10) System.out.print System.out System System.out 10 - n10 10 n10 System.out.println(10 - n1) System.out.println System.out System System.out 10 - n1 10 n1 String[] args args
import java.util.Scanner;

class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();

        int n100 = n / 100;
        int n10 = (n / 10) % 10;
        int n1 = n % 10;
        System.out.print(10 - n100);
        System.out.print(10 - n10);
        System.out.println(10 - n1);
    }
}
