import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc=new Scanner(System.in);
		String s=sc.next();
		
		System.out.println(s.replace('9','o').replace('1', '9').replace('o', '1'));
	}
} import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String[] args) {
		Scanner sc=new Scanner(System.in);
		String s=sc.next();
		
		System.out.println(s.replace('9','o').replace('1', '9').replace('o', '1'));
	}
} Main public static void main(String[] args) {
		Scanner sc=new Scanner(System.in);
		String s=sc.next();
		
		System.out.println(s.replace('9','o').replace('1', '9').replace('o', '1'));
	} main {
		Scanner sc=new Scanner(System.in);
		String s=sc.next();
		
		System.out.println(s.replace('9','o').replace('1', '9').replace('o', '1'));
	} Scanner sc=new Scanner(System.in); sc new Scanner(System.in) String s=sc.next(); s sc.next() sc.next sc System.out.println(s.replace('9','o').replace('1', '9').replace('o', '1')) System.out.println System.out System System.out s.replace('9','o').replace('1', '9').replace('o', '1') s.replace('9','o').replace('1', '9').replace s.replace('9','o').replace('1', '9') s.replace('9','o').replace s.replace('9','o') s.replace s '9' 'o' '1' '9' 'o' '1' String[] args args public class Main {
	public static void main(String[] args) {
		Scanner sc=new Scanner(System.in);
		String s=sc.next();
		
		System.out.println(s.replace('9','o').replace('1', '9').replace('o', '1'));
	}
} public class Main {
	public static void main(String[] args) {
		Scanner sc=new Scanner(System.in);
		String s=sc.next();
		
		System.out.println(s.replace('9','o').replace('1', '9').replace('o', '1'));
	}
} Main
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc=new Scanner(System.in);
		String s=sc.next();
		
		System.out.println(s.replace('9','o').replace('1', '9').replace('o', '1'));
	}
}
