import java.util.*;

public class Main{
	public static void main(String args[]){
		Scanner sc = new Scanner(System.in);

		char c[] = sc.next().toCharArray();

		for(char i : c)
			System.out.print((char)(10 - (i-'0') + '0'));
	}
} import java.util.*; util.* java public class Main{
	public static void main(String args[]){
		Scanner sc = new Scanner(System.in);

		char c[] = sc.next().toCharArray();

		for(char i : c)
			System.out.print((char)(10 - (i-'0') + '0'));
	}
} Main public static void main(String args[]){
		Scanner sc = new Scanner(System.in);

		char c[] = sc.next().toCharArray();

		for(char i : c)
			System.out.print((char)(10 - (i-'0') + '0'));
	} main {
		Scanner sc = new Scanner(System.in);

		char c[] = sc.next().toCharArray();

		for(char i : c)
			System.out.print((char)(10 - (i-'0') + '0'));
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) char c[] = sc.next().toCharArray(); c sc.next().toCharArray() sc.next().toCharArray sc.next() sc.next sc for(char i : c)
			System.out.print((char)(10 - (i-'0') + '0')); char i c System.out.print((char)(10 - (i-'0') + '0')); System.out.print((char)(10 - (i-'0') + '0')) System.out.print System.out System System.out (char)(10 - (i-'0') + '0') 10 - (i-'0') 10 (i-'0') i '0' '0' String args[] args public class Main{
	public static void main(String args[]){
		Scanner sc = new Scanner(System.in);

		char c[] = sc.next().toCharArray();

		for(char i : c)
			System.out.print((char)(10 - (i-'0') + '0'));
	}
} public class Main{
	public static void main(String args[]){
		Scanner sc = new Scanner(System.in);

		char c[] = sc.next().toCharArray();

		for(char i : c)
			System.out.print((char)(10 - (i-'0') + '0'));
	}
} Main
import java.util.*;

public class Main{
	public static void main(String args[]){
		Scanner sc = new Scanner(System.in);

		char c[] = sc.next().toCharArray();

		for(char i : c)
			System.out.print((char)(10 - (i-'0') + '0'));
	}
}