
import java.io.*;
import java.util.Scanner;

public class Main{
    public static void main(String []args) throws IOException
    {
        Scanner sc = new Scanner(System.in);
        String str = sc.next();
        for(int i=0;i<str.length();i++)
        {
            if(str.charAt(i)=='1')
                System.out.print('9');
            else if(str.charAt(i)=='9')
                System.out.print('1');
            else
                System.out.print(str.charAt(i));

        }
        System.out.println();

    }
} import java.io.*; io.* java import java.util.Scanner; Scanner java.util public class Main{
    public static void main(String []args) throws IOException
    {
        Scanner sc = new Scanner(System.in);
        String str = sc.next();
        for(int i=0;i<str.length();i++)
        {
            if(str.charAt(i)=='1')
                System.out.print('9');
            else if(str.charAt(i)=='9')
                System.out.print('1');
            else
                System.out.print(str.charAt(i));

        }
        System.out.println();

    }
} Main public static void main(String []args) throws IOException
    {
        Scanner sc = new Scanner(System.in);
        String str = sc.next();
        for(int i=0;i<str.length();i++)
        {
            if(str.charAt(i)=='1')
                System.out.print('9');
            else if(str.charAt(i)=='9')
                System.out.print('1');
            else
                System.out.print(str.charAt(i));

        }
        System.out.println();

    } main {
        Scanner sc = new Scanner(System.in);
        String str = sc.next();
        for(int i=0;i<str.length();i++)
        {
            if(str.charAt(i)=='1')
                System.out.print('9');
            else if(str.charAt(i)=='9')
                System.out.print('1');
            else
                System.out.print(str.charAt(i));

        }
        System.out.println();

    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String str = sc.next(); str sc.next() sc.next sc for(int i=0;i<str.length();i++)
        {
            if(str.charAt(i)=='1')
                System.out.print('9');
            else if(str.charAt(i)=='9')
                System.out.print('1');
            else
                System.out.print(str.charAt(i));

        } int i=0; int i=0; i 0 i<str.length() i str.length() str.length str i++ i++ i {
            if(str.charAt(i)=='1')
                System.out.print('9');
            else if(str.charAt(i)=='9')
                System.out.print('1');
            else
                System.out.print(str.charAt(i));

        } {
            if(str.charAt(i)=='1')
                System.out.print('9');
            else if(str.charAt(i)=='9')
                System.out.print('1');
            else
                System.out.print(str.charAt(i));

        } if(str.charAt(i)=='1')
                System.out.print('9');
            else if(str.charAt(i)=='9')
                System.out.print('1');
            else
                System.out.print(str.charAt(i)); str.charAt(i)=='1' str.charAt(i) str.charAt str i '1' System.out.print('9') System.out.print System.out System System.out '9' if(str.charAt(i)=='9')
                System.out.print('1');
            else
                System.out.print(str.charAt(i)); str.charAt(i)=='9' str.charAt(i) str.charAt str i '9' System.out.print('1') System.out.print System.out System System.out '1' System.out.print(str.charAt(i)) System.out.print System.out System System.out str.charAt(i) str.charAt str 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
    {
        Scanner sc = new Scanner(System.in);
        String str = sc.next();
        for(int i=0;i<str.length();i++)
        {
            if(str.charAt(i)=='1')
                System.out.print('9');
            else if(str.charAt(i)=='9')
                System.out.print('1');
            else
                System.out.print(str.charAt(i));

        }
        System.out.println();

    }
} public class Main{
    public static void main(String []args) throws IOException
    {
        Scanner sc = new Scanner(System.in);
        String str = sc.next();
        for(int i=0;i<str.length();i++)
        {
            if(str.charAt(i)=='1')
                System.out.print('9');
            else if(str.charAt(i)=='9')
                System.out.print('1');
            else
                System.out.print(str.charAt(i));

        }
        System.out.println();

    }
} Main

import java.io.*;
import java.util.Scanner;

public class Main{
    public static void main(String []args) throws IOException
    {
        Scanner sc = new Scanner(System.in);
        String str = sc.next();
        for(int i=0;i<str.length();i++)
        {
            if(str.charAt(i)=='1')
                System.out.print('9');
            else if(str.charAt(i)=='9')
                System.out.print('1');
            else
                System.out.print(str.charAt(i));

        }
        System.out.println();

    }
}