import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        String str = sc.next();
        
        str = str.replace("1", "2");
        
        str = str.replace("9", "1");
        
        str = str.replace("2", "9");
        
        System.out.println(str);
    }
} import java.util.Scanner; Scanner java.util public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        String str = sc.next();
        
        str = str.replace("1", "2");
        
        str = str.replace("9", "1");
        
        str = str.replace("2", "9");
        
        System.out.println(str);
    }
} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        String str = sc.next();
        
        str = str.replace("1", "2");
        
        str = str.replace("9", "1");
        
        str = str.replace("2", "9");
        
        System.out.println(str);
    } main {
        Scanner sc = new Scanner(System.in);

        String str = sc.next();
        
        str = str.replace("1", "2");
        
        str = str.replace("9", "1");
        
        str = str.replace("2", "9");
        
        System.out.println(str);
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String str = sc.next(); str sc.next() sc.next sc str = str.replace("1", "2") str str.replace("1", "2") str.replace str "1" "2" str = str.replace("9", "1") str str.replace("9", "1") str.replace str "9" "1" str = str.replace("2", "9") str str.replace("2", "9") str.replace str "2" "9" System.out.println(str) System.out.println System.out System System.out str String[] args args public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        String str = sc.next();
        
        str = str.replace("1", "2");
        
        str = str.replace("9", "1");
        
        str = str.replace("2", "9");
        
        System.out.println(str);
    }
} public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        String str = sc.next();
        
        str = str.replace("1", "2");
        
        str = str.replace("9", "1");
        
        str = str.replace("2", "9");
        
        System.out.println(str);
    }
} Main
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        String str = sc.next();
        
        str = str.replace("1", "2");
        
        str = str.replace("9", "1");
        
        str = str.replace("2", "9");
        
        System.out.println(str);
    }
}
