import java.util.*;

class Main {
    private final String defaultN;
    private StringBuilder fixedN;

    Main(String n) {
        this.defaultN = n;
        this.fixedN = new StringBuilder();
    }

    void generateFixedN() {
        for (int i = 0; i < defaultN.length(); i++) {
            fixedN.append(defaultN.charAt(i) == '1' ? '9' : '1');
        }
    }
    
    String getFixedN() {
        return this.fixedN.toString();
    }

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String n = sc.nextLine();
        Main m = new Main(n);
        m.generateFixedN();
        System.out.println(m.getFixedN());
    }
} import java.util.*; util.* java class Main {
    private final String defaultN;
    private StringBuilder fixedN;

    Main(String n) {
        this.defaultN = n;
        this.fixedN = new StringBuilder();
    }

    void generateFixedN() {
        for (int i = 0; i < defaultN.length(); i++) {
            fixedN.append(defaultN.charAt(i) == '1' ? '9' : '1');
        }
    }
    
    String getFixedN() {
        return this.fixedN.toString();
    }

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String n = sc.nextLine();
        Main m = new Main(n);
        m.generateFixedN();
        System.out.println(m.getFixedN());
    }
} Main private final String defaultN; defaultN private StringBuilder fixedN; fixedN Main(String n) {
        this.defaultN = n;
        this.fixedN = new StringBuilder();
    } Main {
        this.defaultN = n;
        this.fixedN = new StringBuilder();
    } this.defaultN = n this.defaultN this this.defaultN n this.fixedN = new StringBuilder() this.fixedN this this.fixedN new StringBuilder() String n n void generateFixedN() {
        for (int i = 0; i < defaultN.length(); i++) {
            fixedN.append(defaultN.charAt(i) == '1' ? '9' : '1');
        }
    } generateFixedN {
        for (int i = 0; i < defaultN.length(); i++) {
            fixedN.append(defaultN.charAt(i) == '1' ? '9' : '1');
        }
    } for (int i = 0; i < defaultN.length(); i++) {
            fixedN.append(defaultN.charAt(i) == '1' ? '9' : '1');
        } int i = 0; int i = 0; i 0 i < defaultN.length() i defaultN.length() defaultN.length defaultN i++ i++ i {
            fixedN.append(defaultN.charAt(i) == '1' ? '9' : '1');
        } {
            fixedN.append(defaultN.charAt(i) == '1' ? '9' : '1');
        } fixedN.append(defaultN.charAt(i) == '1' ? '9' : '1') fixedN.append fixedN defaultN.charAt(i) == '1' ? '9' : '1' defaultN.charAt(i) == '1' defaultN.charAt(i) defaultN.charAt defaultN i '1' '9' '1' String getFixedN() {
        return this.fixedN.toString();
    } getFixedN {
        return this.fixedN.toString();
    } return this.fixedN.toString(); this.fixedN.toString() this.fixedN.toString this.fixedN this this.fixedN public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String n = sc.nextLine();
        Main m = new Main(n);
        m.generateFixedN();
        System.out.println(m.getFixedN());
    } main {
        Scanner sc = new Scanner(System.in);
        String n = sc.nextLine();
        Main m = new Main(n);
        m.generateFixedN();
        System.out.println(m.getFixedN());
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String n = sc.nextLine(); n sc.nextLine() sc.nextLine sc Main m = new Main(n); m new Main(n) m.generateFixedN() m.generateFixedN m System.out.println(m.getFixedN()) System.out.println System.out System System.out m.getFixedN() m.getFixedN m String[] args args
import java.util.*;

class Main {
    private final String defaultN;
    private StringBuilder fixedN;

    Main(String n) {
        this.defaultN = n;
        this.fixedN = new StringBuilder();
    }

    void generateFixedN() {
        for (int i = 0; i < defaultN.length(); i++) {
            fixedN.append(defaultN.charAt(i) == '1' ? '9' : '1');
        }
    }
    
    String getFixedN() {
        return this.fixedN.toString();
    }

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String n = sc.nextLine();
        Main m = new Main(n);
        m.generateFixedN();
        System.out.println(m.getFixedN());
    }
}
