import java.util.Scanner;

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

		String n = sc.next();

		for (int i = 0; i < n.length(); i++) {
			char c = n.charAt(i);
			System.out.print(c == '1' ? '9' : '1');
		}

		System.out.println();

		sc.close();

	}
}
 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();

		for (int i = 0; i < n.length(); i++) {
			char c = n.charAt(i);
			System.out.print(c == '1' ? '9' : '1');
		}

		System.out.println();

		sc.close();

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

		String n = sc.next();

		for (int i = 0; i < n.length(); i++) {
			char c = n.charAt(i);
			System.out.print(c == '1' ? '9' : '1');
		}

		System.out.println();

		sc.close();

	} main {
		Scanner sc = new Scanner(System.in);

		String n = sc.next();

		for (int i = 0; i < n.length(); i++) {
			char c = n.charAt(i);
			System.out.print(c == '1' ? '9' : '1');
		}

		System.out.println();

		sc.close();

	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String n = sc.next(); n sc.next() sc.next sc for (int i = 0; i < n.length(); i++) {
			char c = n.charAt(i);
			System.out.print(c == '1' ? '9' : '1');
		} int i = 0; int i = 0; i 0 i < n.length() i n.length() n.length n i++ i++ i {
			char c = n.charAt(i);
			System.out.print(c == '1' ? '9' : '1');
		} {
			char c = n.charAt(i);
			System.out.print(c == '1' ? '9' : '1');
		} char c = n.charAt(i); c n.charAt(i) n.charAt n i System.out.print(c == '1' ? '9' : '1') System.out.print System.out System System.out c == '1' ? '9' : '1' c == '1' c '1' '9' '1' System.out.println() System.out.println System.out System System.out sc.close() sc.close sc String[] args args public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);

		String n = sc.next();

		for (int i = 0; i < n.length(); i++) {
			char c = n.charAt(i);
			System.out.print(c == '1' ? '9' : '1');
		}

		System.out.println();

		sc.close();

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

		String n = sc.next();

		for (int i = 0; i < n.length(); i++) {
			char c = n.charAt(i);
			System.out.print(c == '1' ? '9' : '1');
		}

		System.out.println();

		sc.close();

	}
} Main
import java.util.Scanner;

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

		String n = sc.next();

		for (int i = 0; i < n.length(); i++) {
			char c = n.charAt(i);
			System.out.print(c == '1' ? '9' : '1');
		}

		System.out.println();

		sc.close();

	}
}

