import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.io.UncheckedIOException;
import java.util.StringTokenizer;
import java.io.IOException;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author mikit
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        LightScanner in = new LightScanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        AAtCoderBeginnerContest999 solver = new AAtCoderBeginnerContest999();
        solver.solve(1, in, out);
        out.close();
    }

    static class AAtCoderBeginnerContest999 {
        public void solve(int testNumber, LightScanner in, PrintWriter out) {
            out.println(in.string().replace('9', '.').replace('1', '9').replace('.', '1'));
        }

    }

    static class LightScanner {
        private BufferedReader reader = null;
        private StringTokenizer tokenizer = null;

        public LightScanner(InputStream in) {
            reader = new BufferedReader(new InputStreamReader(in));
        }

        public String string() {
            if (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new UncheckedIOException(e);
                }
            }
            return tokenizer.nextToken();
        }

    }
}
 import java.io.OutputStream; OutputStream java.io import java.io.IOException; IOException java.io import java.io.InputStream; InputStream java.io import java.io.PrintWriter; PrintWriter java.io import java.io.UncheckedIOException; UncheckedIOException java.io import java.util.StringTokenizer; StringTokenizer java.util import java.io.IOException; IOException java.io import java.io.BufferedReader; BufferedReader java.io import java.io.InputStreamReader; InputStreamReader java.io import java.io.InputStream; InputStream java.io public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        LightScanner in = new LightScanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        AAtCoderBeginnerContest999 solver = new AAtCoderBeginnerContest999();
        solver.solve(1, in, out);
        out.close();
    }

    static class AAtCoderBeginnerContest999 {
        public void solve(int testNumber, LightScanner in, PrintWriter out) {
            out.println(in.string().replace('9', '.').replace('1', '9').replace('.', '1'));
        }

    }

    static class LightScanner {
        private BufferedReader reader = null;
        private StringTokenizer tokenizer = null;

        public LightScanner(InputStream in) {
            reader = new BufferedReader(new InputStreamReader(in));
        }

        public String string() {
            if (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new UncheckedIOException(e);
                }
            }
            return tokenizer.nextToken();
        }

    }
} Main public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        LightScanner in = new LightScanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        AAtCoderBeginnerContest999 solver = new AAtCoderBeginnerContest999();
        solver.solve(1, in, out);
        out.close();
    } main {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        LightScanner in = new LightScanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        AAtCoderBeginnerContest999 solver = new AAtCoderBeginnerContest999();
        solver.solve(1, in, out);
        out.close();
    } InputStream inputStream = System.in; inputStream System.in System System.in OutputStream outputStream = System.out; outputStream System.out System System.out LightScanner in = new LightScanner(inputStream); in new LightScanner(inputStream) PrintWriter out = new PrintWriter(outputStream); out new PrintWriter(outputStream) AAtCoderBeginnerContest999 solver = new AAtCoderBeginnerContest999(); solver new AAtCoderBeginnerContest999() solver.solve(1, in, out) solver.solve solver 1 in out out.close() out.close out String[] args args static class AAtCoderBeginnerContest999 {
        public void solve(int testNumber, LightScanner in, PrintWriter out) {
            out.println(in.string().replace('9', '.').replace('1', '9').replace('.', '1'));
        }

    } AAtCoderBeginnerContest999 public void solve(int testNumber, LightScanner in, PrintWriter out) {
            out.println(in.string().replace('9', '.').replace('1', '9').replace('.', '1'));
        } solve {
            out.println(in.string().replace('9', '.').replace('1', '9').replace('.', '1'));
        } out.println(in.string().replace('9', '.').replace('1', '9').replace('.', '1')) out.println out in.string().replace('9', '.').replace('1', '9').replace('.', '1') in.string().replace('9', '.').replace('1', '9').replace in.string().replace('9', '.').replace('1', '9') in.string().replace('9', '.').replace in.string().replace('9', '.') in.string().replace in.string() in.string in '9' '.' '1' '9' '.' '1' int testNumber testNumber LightScanner in in PrintWriter out out static class LightScanner {
        private BufferedReader reader = null;
        private StringTokenizer tokenizer = null;

        public LightScanner(InputStream in) {
            reader = new BufferedReader(new InputStreamReader(in));
        }

        public String string() {
            if (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new UncheckedIOException(e);
                }
            }
            return tokenizer.nextToken();
        }

    } LightScanner private BufferedReader reader = null; reader null private StringTokenizer tokenizer = null; tokenizer null public LightScanner(InputStream in) {
            reader = new BufferedReader(new InputStreamReader(in));
        } LightScanner {
            reader = new BufferedReader(new InputStreamReader(in));
        } reader = new BufferedReader(new InputStreamReader(in)) reader new BufferedReader(new InputStreamReader(in)) InputStream in in public String string() {
            if (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new UncheckedIOException(e);
                }
            }
            return tokenizer.nextToken();
        } string {
            if (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new UncheckedIOException(e);
                }
            }
            return tokenizer.nextToken();
        } if (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new UncheckedIOException(e);
                }
            } tokenizer == null || !tokenizer.hasMoreTokens() tokenizer == null tokenizer null !tokenizer.hasMoreTokens() tokenizer.hasMoreTokens() tokenizer.hasMoreTokens tokenizer {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new UncheckedIOException(e);
                }
            } try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new UncheckedIOException(e);
                } catch (IOException e) {
                    throw new UncheckedIOException(e);
                } IOException e {
                    throw new UncheckedIOException(e);
                } throw new UncheckedIOException(e); new UncheckedIOException(e) {
                    tokenizer = new StringTokenizer(reader.readLine());
                } tokenizer = new StringTokenizer(reader.readLine()) tokenizer new StringTokenizer(reader.readLine()) return tokenizer.nextToken(); tokenizer.nextToken() tokenizer.nextToken tokenizer public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        LightScanner in = new LightScanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        AAtCoderBeginnerContest999 solver = new AAtCoderBeginnerContest999();
        solver.solve(1, in, out);
        out.close();
    }

    static class AAtCoderBeginnerContest999 {
        public void solve(int testNumber, LightScanner in, PrintWriter out) {
            out.println(in.string().replace('9', '.').replace('1', '9').replace('.', '1'));
        }

    }

    static class LightScanner {
        private BufferedReader reader = null;
        private StringTokenizer tokenizer = null;

        public LightScanner(InputStream in) {
            reader = new BufferedReader(new InputStreamReader(in));
        }

        public String string() {
            if (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new UncheckedIOException(e);
                }
            }
            return tokenizer.nextToken();
        }

    }
} public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        LightScanner in = new LightScanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        AAtCoderBeginnerContest999 solver = new AAtCoderBeginnerContest999();
        solver.solve(1, in, out);
        out.close();
    }

    static class AAtCoderBeginnerContest999 {
        public void solve(int testNumber, LightScanner in, PrintWriter out) {
            out.println(in.string().replace('9', '.').replace('1', '9').replace('.', '1'));
        }

    }

    static class LightScanner {
        private BufferedReader reader = null;
        private StringTokenizer tokenizer = null;

        public LightScanner(InputStream in) {
            reader = new BufferedReader(new InputStreamReader(in));
        }

        public String string() {
            if (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new UncheckedIOException(e);
                }
            }
            return tokenizer.nextToken();
        }

    }
} Main
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.io.UncheckedIOException;
import java.util.StringTokenizer;
import java.io.IOException;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author mikit
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        LightScanner in = new LightScanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        AAtCoderBeginnerContest999 solver = new AAtCoderBeginnerContest999();
        solver.solve(1, in, out);
        out.close();
    }

    static class AAtCoderBeginnerContest999 {
        public void solve(int testNumber, LightScanner in, PrintWriter out) {
            out.println(in.string().replace('9', '.').replace('1', '9').replace('.', '1'));
        }

    }

    static class LightScanner {
        private BufferedReader reader = null;
        private StringTokenizer tokenizer = null;

        public LightScanner(InputStream in) {
            reader = new BufferedReader(new InputStreamReader(in));
        }

        public String string() {
            if (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new UncheckedIOException(e);
                }
            }
            return tokenizer.nextToken();
        }

    }
}

