import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        System.out.println(new Scanner(System.in).next().replace('1', 'a').replace('9', '1').replace('a', '9'));
    }
} import java.util.Scanner; Scanner java.util public class Main {
    public static void main(String[] args) {
        System.out.println(new Scanner(System.in).next().replace('1', 'a').replace('9', '1').replace('a', '9'));
    }
} Main public static void main(String[] args) {
        System.out.println(new Scanner(System.in).next().replace('1', 'a').replace('9', '1').replace('a', '9'));
    } main {
        System.out.println(new Scanner(System.in).next().replace('1', 'a').replace('9', '1').replace('a', '9'));
    } System.out.println(new Scanner(System.in).next().replace('1', 'a').replace('9', '1').replace('a', '9')) System.out.println System.out System System.out new Scanner(System.in).next().replace('1', 'a').replace('9', '1').replace('a', '9') new Scanner(System.in).next().replace('1', 'a').replace('9', '1').replace new Scanner(System.in).next().replace('1', 'a').replace('9', '1') new Scanner(System.in).next().replace('1', 'a').replace new Scanner(System.in).next().replace('1', 'a') new Scanner(System.in).next().replace new Scanner(System.in).next() new Scanner(System.in).next new Scanner(System.in) '1' 'a' '9' '1' 'a' '9' String[] args args public class Main {
    public static void main(String[] args) {
        System.out.println(new Scanner(System.in).next().replace('1', 'a').replace('9', '1').replace('a', '9'));
    }
} public class Main {
    public static void main(String[] args) {
        System.out.println(new Scanner(System.in).next().replace('1', 'a').replace('9', '1').replace('a', '9'));
    }
} Main
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        System.out.println(new Scanner(System.in).next().replace('1', 'a').replace('9', '1').replace('a', '9'));
    }
}