
import java.util.Scanner;
public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String A = sc.next();
		String B = A.replace("1", "2");
		String C = B.replace("9", "3");
		String D = C.replace("2", "9");
		String E = D.replace("3", "1");
		System.out.println(E);
	}
} import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String A = sc.next();
		String B = A.replace("1", "2");
		String C = B.replace("9", "3");
		String D = C.replace("2", "9");
		String E = D.replace("3", "1");
		System.out.println(E);
	}
} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String A = sc.next();
		String B = A.replace("1", "2");
		String C = B.replace("9", "3");
		String D = C.replace("2", "9");
		String E = D.replace("3", "1");
		System.out.println(E);
	} main {
		Scanner sc = new Scanner(System.in);
		String A = sc.next();
		String B = A.replace("1", "2");
		String C = B.replace("9", "3");
		String D = C.replace("2", "9");
		String E = D.replace("3", "1");
		System.out.println(E);
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String A = sc.next(); A sc.next() sc.next sc String B = A.replace("1", "2"); B A.replace("1", "2") A.replace A "1" "2" String C = B.replace("9", "3"); C B.replace("9", "3") B.replace B "9" "3" String D = C.replace("2", "9"); D C.replace("2", "9") C.replace C "2" "9" String E = D.replace("3", "1"); E D.replace("3", "1") D.replace D "3" "1" System.out.println(E) System.out.println System.out System System.out E String[] args args public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String A = sc.next();
		String B = A.replace("1", "2");
		String C = B.replace("9", "3");
		String D = C.replace("2", "9");
		String E = D.replace("3", "1");
		System.out.println(E);
	}
} public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String A = sc.next();
		String B = A.replace("1", "2");
		String C = B.replace("9", "3");
		String D = C.replace("2", "9");
		String E = D.replace("3", "1");
		System.out.println(E);
	}
} Main

import java.util.Scanner;
public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String A = sc.next();
		String B = A.replace("1", "2");
		String C = B.replace("9", "3");
		String D = C.replace("2", "9");
		String E = D.replace("3", "1");
		System.out.println(E);
	}
}
