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