import java.io.IOException;

import java.io.BufferedReader;
import java.io.InputStreamReader;

@SuppressWarnings("unchecked")
public class Main {
    public static void main(String[] args) throws IOException {
        final String s;

        try (
            BufferedReader reader = new BufferedReader(
                new InputStreamReader(System.in))) {
            s = reader.readLine();
        }

        for (int i = 0; i < s.length(); i++)
            if (s.charAt(i) == '1') System.out.print("9");
            else if (s.charAt(i) == '9') System.out.print("1");
            else System.out.print(s.charAt(i));

        System.out.println();
    }
} import java.io.IOException; IOException java.io import java.io.BufferedReader; BufferedReader java.io import java.io.InputStreamReader; InputStreamReader java.io public class Main {
    public static void main(String[] args) throws IOException {
        final String s;

        try (
            BufferedReader reader = new BufferedReader(
                new InputStreamReader(System.in))) {
            s = reader.readLine();
        }

        for (int i = 0; i < s.length(); i++)
            if (s.charAt(i) == '1') System.out.print("9");
            else if (s.charAt(i) == '9') System.out.print("1");
            else System.out.print(s.charAt(i));

        System.out.println();
    }
} Main public static void main(String[] args) throws IOException {
        final String s;

        try (
            BufferedReader reader = new BufferedReader(
                new InputStreamReader(System.in))) {
            s = reader.readLine();
        }

        for (int i = 0; i < s.length(); i++)
            if (s.charAt(i) == '1') System.out.print("9");
            else if (s.charAt(i) == '9') System.out.print("1");
            else System.out.print(s.charAt(i));

        System.out.println();
    } main {
        final String s;

        try (
            BufferedReader reader = new BufferedReader(
                new InputStreamReader(System.in))) {
            s = reader.readLine();
        }

        for (int i = 0; i < s.length(); i++)
            if (s.charAt(i) == '1') System.out.print("9");
            else if (s.charAt(i) == '9') System.out.print("1");
            else System.out.print(s.charAt(i));

        System.out.println();
    } final String s; s try (
            BufferedReader reader = new BufferedReader(
                new InputStreamReader(System.in))) {
            s = reader.readLine();
        } {
            s = reader.readLine();
        } BufferedReader reader = new BufferedReader(
                new InputStreamReader(System.in)) BufferedReader reader = new BufferedReader(
                new InputStreamReader(System.in)) new BufferedReader(
                new InputStreamReader(System.in)) s = reader.readLine() s reader.readLine() reader.readLine reader for (int i = 0; i < s.length(); i++)
            if (s.charAt(i) == '1') System.out.print("9");
            else if (s.charAt(i) == '9') System.out.print("1");
            else System.out.print(s.charAt(i)); int i = 0; int i = 0; i 0 i < s.length() i s.length() s.length s i++ i++ i if (s.charAt(i) == '1') System.out.print("9");
            else if (s.charAt(i) == '9') System.out.print("1");
            else System.out.print(s.charAt(i)); if (s.charAt(i) == '1') System.out.print("9");
            else if (s.charAt(i) == '9') System.out.print("1");
            else System.out.print(s.charAt(i)); s.charAt(i) == '1' s.charAt(i) s.charAt s i '1' System.out.print("9") System.out.print System.out System System.out "9" if (s.charAt(i) == '9') System.out.print("1");
            else System.out.print(s.charAt(i)); s.charAt(i) == '9' s.charAt(i) s.charAt s i '9' System.out.print("1") System.out.print System.out System System.out "1" System.out.print(s.charAt(i)) System.out.print System.out System System.out s.charAt(i) s.charAt s i System.out.println() System.out.println System.out System System.out String[] args args public class Main {
    public static void main(String[] args) throws IOException {
        final String s;

        try (
            BufferedReader reader = new BufferedReader(
                new InputStreamReader(System.in))) {
            s = reader.readLine();
        }

        for (int i = 0; i < s.length(); i++)
            if (s.charAt(i) == '1') System.out.print("9");
            else if (s.charAt(i) == '9') System.out.print("1");
            else System.out.print(s.charAt(i));

        System.out.println();
    }
} public class Main {
    public static void main(String[] args) throws IOException {
        final String s;

        try (
            BufferedReader reader = new BufferedReader(
                new InputStreamReader(System.in))) {
            s = reader.readLine();
        }

        for (int i = 0; i < s.length(); i++)
            if (s.charAt(i) == '1') System.out.print("9");
            else if (s.charAt(i) == '9') System.out.print("1");
            else System.out.print(s.charAt(i));

        System.out.println();
    }
} Main
import java.io.IOException;

import java.io.BufferedReader;
import java.io.InputStreamReader;

@SuppressWarnings("unchecked")
public class Main {
    public static void main(String[] args) throws IOException {
        final String s;

        try (
            BufferedReader reader = new BufferedReader(
                new InputStreamReader(System.in))) {
            s = reader.readLine();
        }

        for (int i = 0; i < s.length(); i++)
            if (s.charAt(i) == '1') System.out.print("9");
            else if (s.charAt(i) == '9') System.out.print("1");
            else System.out.print(s.charAt(i));

        System.out.println();
    }
}
