import java.util.*;

public class Main {
	public static void main(String[] args) {  
  		Scanner sc = new Scanner(System.in);
		String n = sc.next();
      	String[] ary = n.split("");
      
      	for(int i = 0; i < ary.length; i++) {
        	if(ary[i].equals("1")) {
            	ary[i] = "9";
            } else if(ary[i].equals("9")) {
              	ary[i] = "1";
            }
  			System.out.print(ary[i]);
        }
    }
} import java.util.*; util.* java public class Main {
	public static void main(String[] args) {  
  		Scanner sc = new Scanner(System.in);
		String n = sc.next();
      	String[] ary = n.split("");
      
      	for(int i = 0; i < ary.length; i++) {
        	if(ary[i].equals("1")) {
            	ary[i] = "9";
            } else if(ary[i].equals("9")) {
              	ary[i] = "1";
            }
  			System.out.print(ary[i]);
        }
    }
} Main public static void main(String[] args) {  
  		Scanner sc = new Scanner(System.in);
		String n = sc.next();
      	String[] ary = n.split("");
      
      	for(int i = 0; i < ary.length; i++) {
        	if(ary[i].equals("1")) {
            	ary[i] = "9";
            } else if(ary[i].equals("9")) {
              	ary[i] = "1";
            }
  			System.out.print(ary[i]);
        }
    } main {  
  		Scanner sc = new Scanner(System.in);
		String n = sc.next();
      	String[] ary = n.split("");
      
      	for(int i = 0; i < ary.length; i++) {
        	if(ary[i].equals("1")) {
            	ary[i] = "9";
            } else if(ary[i].equals("9")) {
              	ary[i] = "1";
            }
  			System.out.print(ary[i]);
        }
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String n = sc.next(); n sc.next() sc.next sc String[] ary = n.split(""); ary n.split("") n.split n "" for(int i = 0; i < ary.length; i++) {
        	if(ary[i].equals("1")) {
            	ary[i] = "9";
            } else if(ary[i].equals("9")) {
              	ary[i] = "1";
            }
  			System.out.print(ary[i]);
        } int i = 0; int i = 0; i 0 i < ary.length i ary.length ary ary.length i++ i++ i {
        	if(ary[i].equals("1")) {
            	ary[i] = "9";
            } else if(ary[i].equals("9")) {
              	ary[i] = "1";
            }
  			System.out.print(ary[i]);
        } {
        	if(ary[i].equals("1")) {
            	ary[i] = "9";
            } else if(ary[i].equals("9")) {
              	ary[i] = "1";
            }
  			System.out.print(ary[i]);
        } if(ary[i].equals("1")) {
            	ary[i] = "9";
            } else if(ary[i].equals("9")) {
              	ary[i] = "1";
            } ary[i].equals("1") ary[i].equals ary[i] ary i "1" {
            	ary[i] = "9";
            } ary[i] = "9" ary[i] ary i "9" if(ary[i].equals("9")) {
              	ary[i] = "1";
            } ary[i].equals("9") ary[i].equals ary[i] ary i "9" {
              	ary[i] = "1";
            } ary[i] = "1" ary[i] ary i "1" System.out.print(ary[i]) System.out.print System.out System System.out ary[i] ary i String[] args args public class Main {
	public static void main(String[] args) {  
  		Scanner sc = new Scanner(System.in);
		String n = sc.next();
      	String[] ary = n.split("");
      
      	for(int i = 0; i < ary.length; i++) {
        	if(ary[i].equals("1")) {
            	ary[i] = "9";
            } else if(ary[i].equals("9")) {
              	ary[i] = "1";
            }
  			System.out.print(ary[i]);
        }
    }
} public class Main {
	public static void main(String[] args) {  
  		Scanner sc = new Scanner(System.in);
		String n = sc.next();
      	String[] ary = n.split("");
      
      	for(int i = 0; i < ary.length; i++) {
        	if(ary[i].equals("1")) {
            	ary[i] = "9";
            } else if(ary[i].equals("9")) {
              	ary[i] = "1";
            }
  			System.out.print(ary[i]);
        }
    }
} Main
import java.util.*;

public class Main {
	public static void main(String[] args) {  
  		Scanner sc = new Scanner(System.in);
		String n = sc.next();
      	String[] ary = n.split("");
      
      	for(int i = 0; i < ary.length; i++) {
        	if(ary[i].equals("1")) {
            	ary[i] = "9";
            } else if(ary[i].equals("9")) {
              	ary[i] = "1";
            }
  			System.out.print(ary[i]);
        }
    }
}