import java.util.Scanner;

public class Main
{
	public static void main(String args[])
	{
		Scanner sc = new Scanner(System.in);
		int n;
		n=sc.nextInt();
		char ch[] = String.valueOf(n).toCharArray();
		for(int i=0;i<3;i++)
		{
			if(ch[i]==49)
				ch[i]=57;
			else
				ch[i]=49;
		}
		System.out.println(ch);
	}
} import java.util.Scanner; Scanner java.util public class Main
{
	public static void main(String args[])
	{
		Scanner sc = new Scanner(System.in);
		int n;
		n=sc.nextInt();
		char ch[] = String.valueOf(n).toCharArray();
		for(int i=0;i<3;i++)
		{
			if(ch[i]==49)
				ch[i]=57;
			else
				ch[i]=49;
		}
		System.out.println(ch);
	}
} Main public static void main(String args[])
	{
		Scanner sc = new Scanner(System.in);
		int n;
		n=sc.nextInt();
		char ch[] = String.valueOf(n).toCharArray();
		for(int i=0;i<3;i++)
		{
			if(ch[i]==49)
				ch[i]=57;
			else
				ch[i]=49;
		}
		System.out.println(ch);
	} main {
		Scanner sc = new Scanner(System.in);
		int n;
		n=sc.nextInt();
		char ch[] = String.valueOf(n).toCharArray();
		for(int i=0;i<3;i++)
		{
			if(ch[i]==49)
				ch[i]=57;
			else
				ch[i]=49;
		}
		System.out.println(ch);
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int n; n n=sc.nextInt() n sc.nextInt() sc.nextInt sc char ch[] = String.valueOf(n).toCharArray(); ch String.valueOf(n).toCharArray() String.valueOf(n).toCharArray String.valueOf(n) String.valueOf String n for(int i=0;i<3;i++)
		{
			if(ch[i]==49)
				ch[i]=57;
			else
				ch[i]=49;
		} int i=0; int i=0; i 0 i<3 i 3 i++ i++ i {
			if(ch[i]==49)
				ch[i]=57;
			else
				ch[i]=49;
		} {
			if(ch[i]==49)
				ch[i]=57;
			else
				ch[i]=49;
		} if(ch[i]==49)
				ch[i]=57;
			else
				ch[i]=49; ch[i]==49 ch[i] ch i 49 ch[i]=57 ch[i] ch i 57 ch[i]=49 ch[i] ch i 49 System.out.println(ch) System.out.println System.out System System.out ch String args[] args public class Main
{
	public static void main(String args[])
	{
		Scanner sc = new Scanner(System.in);
		int n;
		n=sc.nextInt();
		char ch[] = String.valueOf(n).toCharArray();
		for(int i=0;i<3;i++)
		{
			if(ch[i]==49)
				ch[i]=57;
			else
				ch[i]=49;
		}
		System.out.println(ch);
	}
} public class Main
{
	public static void main(String args[])
	{
		Scanner sc = new Scanner(System.in);
		int n;
		n=sc.nextInt();
		char ch[] = String.valueOf(n).toCharArray();
		for(int i=0;i<3;i++)
		{
			if(ch[i]==49)
				ch[i]=57;
			else
				ch[i]=49;
		}
		System.out.println(ch);
	}
} Main
import java.util.Scanner;

public class Main
{
	public static void main(String args[])
	{
		Scanner sc = new Scanner(System.in);
		int n;
		n=sc.nextInt();
		char ch[] = String.valueOf(n).toCharArray();
		for(int i=0;i<3;i++)
		{
			if(ch[i]==49)
				ch[i]=57;
			else
				ch[i]=49;
		}
		System.out.println(ch);
	}
}
