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