import java.util.Scanner;

public class Main {
    public static void main(String args[]){
        Scanner scanner = new Scanner(System.in);
        StringBuffer n = new StringBuffer(scanner.next());
        for(int i = 0; i < n.length(); i++){
            switch (n.charAt(i)){
                case '1':
                    n.setCharAt(i, '9');
                    break;
                case '9':
                    n.setCharAt(i, '1');
                    break;
            }
        }
        System.out.println(n);
    }
} import java.util.Scanner; Scanner java.util public class Main {
    public static void main(String args[]){
        Scanner scanner = new Scanner(System.in);
        StringBuffer n = new StringBuffer(scanner.next());
        for(int i = 0; i < n.length(); i++){
            switch (n.charAt(i)){
                case '1':
                    n.setCharAt(i, '9');
                    break;
                case '9':
                    n.setCharAt(i, '1');
                    break;
            }
        }
        System.out.println(n);
    }
} Main public static void main(String args[]){
        Scanner scanner = new Scanner(System.in);
        StringBuffer n = new StringBuffer(scanner.next());
        for(int i = 0; i < n.length(); i++){
            switch (n.charAt(i)){
                case '1':
                    n.setCharAt(i, '9');
                    break;
                case '9':
                    n.setCharAt(i, '1');
                    break;
            }
        }
        System.out.println(n);
    } main {
        Scanner scanner = new Scanner(System.in);
        StringBuffer n = new StringBuffer(scanner.next());
        for(int i = 0; i < n.length(); i++){
            switch (n.charAt(i)){
                case '1':
                    n.setCharAt(i, '9');
                    break;
                case '9':
                    n.setCharAt(i, '1');
                    break;
            }
        }
        System.out.println(n);
    } Scanner scanner = new Scanner(System.in); scanner new Scanner(System.in) StringBuffer n = new StringBuffer(scanner.next()); n new StringBuffer(scanner.next()) for(int i = 0; i < n.length(); i++){
            switch (n.charAt(i)){
                case '1':
                    n.setCharAt(i, '9');
                    break;
                case '9':
                    n.setCharAt(i, '1');
                    break;
            }
        } int i = 0; int i = 0; i 0 i < n.length() i n.length() n.length n i++ i++ i {
            switch (n.charAt(i)){
                case '1':
                    n.setCharAt(i, '9');
                    break;
                case '9':
                    n.setCharAt(i, '1');
                    break;
            }
        } {
            switch (n.charAt(i)){
                case '1':
                    n.setCharAt(i, '9');
                    break;
                case '9':
                    n.setCharAt(i, '1');
                    break;
            }
        } switch (n.charAt(i)){
                case '1':
                    n.setCharAt(i, '9');
                    break;
                case '9':
                    n.setCharAt(i, '1');
                    break;
            } n.charAt(i) n.charAt n i case '1': '1' case '1': n.setCharAt(i, '9') n.setCharAt n i '9' break; case '9': '9' case '9': n.setCharAt(i, '1') n.setCharAt n i '1' break; System.out.println(n) System.out.println System.out System System.out n String args[] args public class Main {
    public static void main(String args[]){
        Scanner scanner = new Scanner(System.in);
        StringBuffer n = new StringBuffer(scanner.next());
        for(int i = 0; i < n.length(); i++){
            switch (n.charAt(i)){
                case '1':
                    n.setCharAt(i, '9');
                    break;
                case '9':
                    n.setCharAt(i, '1');
                    break;
            }
        }
        System.out.println(n);
    }
} public class Main {
    public static void main(String args[]){
        Scanner scanner = new Scanner(System.in);
        StringBuffer n = new StringBuffer(scanner.next());
        for(int i = 0; i < n.length(); i++){
            switch (n.charAt(i)){
                case '1':
                    n.setCharAt(i, '9');
                    break;
                case '9':
                    n.setCharAt(i, '1');
                    break;
            }
        }
        System.out.println(n);
    }
} Main
import java.util.Scanner;

public class Main {
    public static void main(String args[]){
        Scanner scanner = new Scanner(System.in);
        StringBuffer n = new StringBuffer(scanner.next());
        for(int i = 0; i < n.length(); i++){
            switch (n.charAt(i)){
                case '1':
                    n.setCharAt(i, '9');
                    break;
                case '9':
                    n.setCharAt(i, '1');
                    break;
            }
        }
        System.out.println(n);
    }
}