import java.util.*;

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

        Scanner sc = new Scanner(System.in);

        String S = sc.next();
        for (int i = 0; i < S.length(); i++) {
            System.out.print( S.substring( i, i+1 ).equals("1") ? "9" : "1" );
        }
        sc.close();
    }
} import java.util.*; util.* java public class Main {
    public static void main(String[] args){

        Scanner sc = new Scanner(System.in);

        String S = sc.next();
        for (int i = 0; i < S.length(); i++) {
            System.out.print( S.substring( i, i+1 ).equals("1") ? "9" : "1" );
        }
        sc.close();
    }
} Main public static void main(String[] args){

        Scanner sc = new Scanner(System.in);

        String S = sc.next();
        for (int i = 0; i < S.length(); i++) {
            System.out.print( S.substring( i, i+1 ).equals("1") ? "9" : "1" );
        }
        sc.close();
    } main {

        Scanner sc = new Scanner(System.in);

        String S = sc.next();
        for (int i = 0; i < S.length(); i++) {
            System.out.print( S.substring( i, i+1 ).equals("1") ? "9" : "1" );
        }
        sc.close();
    } 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++) {
            System.out.print( S.substring( i, i+1 ).equals("1") ? "9" : "1" );
        } int i = 0; int i = 0; i 0 i < S.length() i S.length() S.length S i++ i++ i {
            System.out.print( S.substring( i, i+1 ).equals("1") ? "9" : "1" );
        } {
            System.out.print( S.substring( i, i+1 ).equals("1") ? "9" : "1" );
        } System.out.print( S.substring( i, i+1 ).equals("1") ? "9" : "1" ) System.out.print System.out System System.out S.substring( i, i+1 ).equals("1") ? "9" : "1" S.substring( i, i+1 ).equals("1") S.substring( i, i+1 ).equals S.substring( i, i+1 ) S.substring S i i+1 i 1 "1" "9" "1" sc.close() sc.close sc String[] args args public class Main {
    public static void main(String[] args){

        Scanner sc = new Scanner(System.in);

        String S = sc.next();
        for (int i = 0; i < S.length(); i++) {
            System.out.print( S.substring( i, i+1 ).equals("1") ? "9" : "1" );
        }
        sc.close();
    }
} public class Main {
    public static void main(String[] args){

        Scanner sc = new Scanner(System.in);

        String S = sc.next();
        for (int i = 0; i < S.length(); i++) {
            System.out.print( S.substring( i, i+1 ).equals("1") ? "9" : "1" );
        }
        sc.close();
    }
} Main
import java.util.*;

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

        Scanner sc = new Scanner(System.in);

        String S = sc.next();
        for (int i = 0; i < S.length(); i++) {
            System.out.print( S.substring( i, i+1 ).equals("1") ? "9" : "1" );
        }
        sc.close();
    }
}