import java.util.*;

class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        String n = sc.next();
        for(int i = 0;i < n.length();i++){
            char s = n.charAt(i);

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

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

            if(s == '1'){
                s = '9';
                System.out.print(s);
            }else{
                s = '1';
                System.out.print(s);
            }
        }
    } main {
        Scanner sc = new Scanner(System.in);
        String n = sc.next();
        for(int i = 0;i < n.length();i++){
            char s = n.charAt(i);

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

            if(s == '1'){
                s = '9';
                System.out.print(s);
            }else{
                s = '1';
                System.out.print(s);
            }
        } int i = 0; int i = 0; i 0 i < n.length() i n.length() n.length n i++ i++ i {
            char s = n.charAt(i);

            if(s == '1'){
                s = '9';
                System.out.print(s);
            }else{
                s = '1';
                System.out.print(s);
            }
        } {
            char s = n.charAt(i);

            if(s == '1'){
                s = '9';
                System.out.print(s);
            }else{
                s = '1';
                System.out.print(s);
            }
        } char s = n.charAt(i); s n.charAt(i) n.charAt n i if(s == '1'){
                s = '9';
                System.out.print(s);
            }else{
                s = '1';
                System.out.print(s);
            } s == '1' s '1' {
                s = '9';
                System.out.print(s);
            } s = '9' s '9' System.out.print(s) System.out.print System.out System System.out s {
                s = '1';
                System.out.print(s);
            } s = '1' s '1' System.out.print(s) System.out.print System.out System System.out s String[] args args
import java.util.*;

class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        String n = sc.next();
        for(int i = 0;i < n.length();i++){
            char s = n.charAt(i);

            if(s == '1'){
                s = '9';
                System.out.print(s);
            }else{
                s = '1';
                System.out.print(s);
            }
        }
    }
}