import java.util.Scanner;

public class Main {

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

		String n = sc.next();
		
		StringBuilder sb = new StringBuilder(n);
		
		for(int i = 0; i < n.length(); i++) {
			sb.setCharAt(i, n.charAt(i) == '1' ? '9' : '1');
		}
		
		System.out.println(sb.toString());
	}
} import java.util.Scanner; Scanner java.util public class Main {

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

		String n = sc.next();
		
		StringBuilder sb = new StringBuilder(n);
		
		for(int i = 0; i < n.length(); i++) {
			sb.setCharAt(i, n.charAt(i) == '1' ? '9' : '1');
		}
		
		System.out.println(sb.toString());
	}
} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);

		String n = sc.next();
		
		StringBuilder sb = new StringBuilder(n);
		
		for(int i = 0; i < n.length(); i++) {
			sb.setCharAt(i, n.charAt(i) == '1' ? '9' : '1');
		}
		
		System.out.println(sb.toString());
	} main {
		Scanner sc = new Scanner(System.in);

		String n = sc.next();
		
		StringBuilder sb = new StringBuilder(n);
		
		for(int i = 0; i < n.length(); i++) {
			sb.setCharAt(i, n.charAt(i) == '1' ? '9' : '1');
		}
		
		System.out.println(sb.toString());
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String n = sc.next(); n sc.next() sc.next sc StringBuilder sb = new StringBuilder(n); sb new StringBuilder(n) for(int i = 0; i < n.length(); i++) {
			sb.setCharAt(i, n.charAt(i) == '1' ? '9' : '1');
		} int i = 0; int i = 0; i 0 i < n.length() i n.length() n.length n i++ i++ i {
			sb.setCharAt(i, n.charAt(i) == '1' ? '9' : '1');
		} {
			sb.setCharAt(i, n.charAt(i) == '1' ? '9' : '1');
		} sb.setCharAt(i, n.charAt(i) == '1' ? '9' : '1') sb.setCharAt sb i n.charAt(i) == '1' ? '9' : '1' n.charAt(i) == '1' n.charAt(i) n.charAt n i '1' '9' '1' System.out.println(sb.toString()) System.out.println System.out System System.out sb.toString() sb.toString sb String[] args args public class Main {

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

		String n = sc.next();
		
		StringBuilder sb = new StringBuilder(n);
		
		for(int i = 0; i < n.length(); i++) {
			sb.setCharAt(i, n.charAt(i) == '1' ? '9' : '1');
		}
		
		System.out.println(sb.toString());
	}
} public class Main {

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

		String n = sc.next();
		
		StringBuilder sb = new StringBuilder(n);
		
		for(int i = 0; i < n.length(); i++) {
			sb.setCharAt(i, n.charAt(i) == '1' ? '9' : '1');
		}
		
		System.out.println(sb.toString());
	}
} Main
import java.util.Scanner;

public class Main {

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

		String n = sc.next();
		
		StringBuilder sb = new StringBuilder(n);
		
		for(int i = 0; i < n.length(); i++) {
			sb.setCharAt(i, n.charAt(i) == '1' ? '9' : '1');
		}
		
		System.out.println(sb.toString());
	}
}
