
import java.io.*;
import java.util.*;

class Main{
    public static void main(String[] args){
        solve();
    }

    public static void solve(){
        Scanner sc = new Scanner(System.in);
        String s = sc.next();
        for(int i=0;i<s.length();i++){
        	if(s.charAt(i)=='1'){
        		System.out.print(9);
        	}
        	else{
        		System.out.print(1);
        	}
        }
        System.out.println();
    }
} import java.io.*; io.* java import java.util.*; util.* java class Main{
    public static void main(String[] args){
        solve();
    }

    public static void solve(){
        Scanner sc = new Scanner(System.in);
        String s = sc.next();
        for(int i=0;i<s.length();i++){
        	if(s.charAt(i)=='1'){
        		System.out.print(9);
        	}
        	else{
        		System.out.print(1);
        	}
        }
        System.out.println();
    }
} Main public static void main(String[] args){
        solve();
    } main {
        solve();
    } solve() solve String[] args args public static void solve(){
        Scanner sc = new Scanner(System.in);
        String s = sc.next();
        for(int i=0;i<s.length();i++){
        	if(s.charAt(i)=='1'){
        		System.out.print(9);
        	}
        	else{
        		System.out.print(1);
        	}
        }
        System.out.println();
    } solve {
        Scanner sc = new Scanner(System.in);
        String s = sc.next();
        for(int i=0;i<s.length();i++){
        	if(s.charAt(i)=='1'){
        		System.out.print(9);
        	}
        	else{
        		System.out.print(1);
        	}
        }
        System.out.println();
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String s = sc.next(); s sc.next() sc.next sc for(int i=0;i<s.length();i++){
        	if(s.charAt(i)=='1'){
        		System.out.print(9);
        	}
        	else{
        		System.out.print(1);
        	}
        } int i=0; int i=0; i 0 i<s.length() i s.length() s.length s i++ i++ i {
        	if(s.charAt(i)=='1'){
        		System.out.print(9);
        	}
        	else{
        		System.out.print(1);
        	}
        } {
        	if(s.charAt(i)=='1'){
        		System.out.print(9);
        	}
        	else{
        		System.out.print(1);
        	}
        } if(s.charAt(i)=='1'){
        		System.out.print(9);
        	}
        	else{
        		System.out.print(1);
        	} s.charAt(i)=='1' s.charAt(i) s.charAt s i '1' {
        		System.out.print(9);
        	} System.out.print(9) System.out.print System.out System System.out 9 {
        		System.out.print(1);
        	} System.out.print(1) System.out.print System.out System System.out 1 System.out.println() System.out.println System.out System System.out

import java.io.*;
import java.util.*;

class Main{
    public static void main(String[] args){
        solve();
    }

    public static void solve(){
        Scanner sc = new Scanner(System.in);
        String s = sc.next();
        for(int i=0;i<s.length();i++){
        	if(s.charAt(i)=='1'){
        		System.out.print(9);
        	}
        	else{
        		System.out.print(1);
        	}
        }
        System.out.println();
    }
}