    import java.util.*;
    import static java.lang.System.*;

public class Main {

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

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

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

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

public class Main {

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