
import java.util.*;
public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
  //    String[] nyu=sc.nextLine().split(" ");

     String nyu=sc.nextLine();
//int[] num=new int[6];
//int A=Integer.parseInt(nyu[0]);
//int B=Integer.parseInt(nyu[1]);
//int C=Integer.parseInt(nyu);
//double A=Double.parseDouble(nyu[0]);
//double B=Double.parseDouble(nyu[1]);
/*
switch(C){
case 7:
case 5:
case 3:
System.out.println("YES") ;
break;
default:
System.out.println("NO") ;

break;
}
*/

nyu=nyu.replaceAll("1","e");
nyu=nyu.replaceAll("9","g");
nyu=nyu.replaceAll("e","9");
nyu=nyu.replaceAll("g","1");


System.out.println(nyu) ;

	}
} import java.util.*; util.* java public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
  //    String[] nyu=sc.nextLine().split(" ");

     String nyu=sc.nextLine();
//int[] num=new int[6];
//int A=Integer.parseInt(nyu[0]);
//int B=Integer.parseInt(nyu[1]);
//int C=Integer.parseInt(nyu);
//double A=Double.parseDouble(nyu[0]);
//double B=Double.parseDouble(nyu[1]);
/*
switch(C){
case 7:
case 5:
case 3:
System.out.println("YES") ;
break;
default:
System.out.println("NO") ;

break;
}
*/

nyu=nyu.replaceAll("1","e");
nyu=nyu.replaceAll("9","g");
nyu=nyu.replaceAll("e","9");
nyu=nyu.replaceAll("g","1");


System.out.println(nyu) ;

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

     String nyu=sc.nextLine();
//int[] num=new int[6];
//int A=Integer.parseInt(nyu[0]);
//int B=Integer.parseInt(nyu[1]);
//int C=Integer.parseInt(nyu);
//double A=Double.parseDouble(nyu[0]);
//double B=Double.parseDouble(nyu[1]);
/*
switch(C){
case 7:
case 5:
case 3:
System.out.println("YES") ;
break;
default:
System.out.println("NO") ;

break;
}
*/

nyu=nyu.replaceAll("1","e");
nyu=nyu.replaceAll("9","g");
nyu=nyu.replaceAll("e","9");
nyu=nyu.replaceAll("g","1");


System.out.println(nyu) ;

	} main {
		Scanner sc = new Scanner(System.in);
  //    String[] nyu=sc.nextLine().split(" ");

     String nyu=sc.nextLine();
//int[] num=new int[6];
//int A=Integer.parseInt(nyu[0]);
//int B=Integer.parseInt(nyu[1]);
//int C=Integer.parseInt(nyu);
//double A=Double.parseDouble(nyu[0]);
//double B=Double.parseDouble(nyu[1]);
/*
switch(C){
case 7:
case 5:
case 3:
System.out.println("YES") ;
break;
default:
System.out.println("NO") ;

break;
}
*/

nyu=nyu.replaceAll("1","e");
nyu=nyu.replaceAll("9","g");
nyu=nyu.replaceAll("e","9");
nyu=nyu.replaceAll("g","1");


System.out.println(nyu) ;

	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String nyu=sc.nextLine(); nyu sc.nextLine() sc.nextLine sc nyu=nyu.replaceAll("1","e") nyu nyu.replaceAll("1","e") nyu.replaceAll nyu "1" "e" nyu=nyu.replaceAll("9","g") nyu nyu.replaceAll("9","g") nyu.replaceAll nyu "9" "g" nyu=nyu.replaceAll("e","9") nyu nyu.replaceAll("e","9") nyu.replaceAll nyu "e" "9" nyu=nyu.replaceAll("g","1") nyu nyu.replaceAll("g","1") nyu.replaceAll nyu "g" "1" System.out.println(nyu) System.out.println System.out System System.out nyu String[] args args public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
  //    String[] nyu=sc.nextLine().split(" ");

     String nyu=sc.nextLine();
//int[] num=new int[6];
//int A=Integer.parseInt(nyu[0]);
//int B=Integer.parseInt(nyu[1]);
//int C=Integer.parseInt(nyu);
//double A=Double.parseDouble(nyu[0]);
//double B=Double.parseDouble(nyu[1]);
/*
switch(C){
case 7:
case 5:
case 3:
System.out.println("YES") ;
break;
default:
System.out.println("NO") ;

break;
}
*/

nyu=nyu.replaceAll("1","e");
nyu=nyu.replaceAll("9","g");
nyu=nyu.replaceAll("e","9");
nyu=nyu.replaceAll("g","1");


System.out.println(nyu) ;

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

     String nyu=sc.nextLine();
//int[] num=new int[6];
//int A=Integer.parseInt(nyu[0]);
//int B=Integer.parseInt(nyu[1]);
//int C=Integer.parseInt(nyu);
//double A=Double.parseDouble(nyu[0]);
//double B=Double.parseDouble(nyu[1]);
/*
switch(C){
case 7:
case 5:
case 3:
System.out.println("YES") ;
break;
default:
System.out.println("NO") ;

break;
}
*/

nyu=nyu.replaceAll("1","e");
nyu=nyu.replaceAll("9","g");
nyu=nyu.replaceAll("e","9");
nyu=nyu.replaceAll("g","1");


System.out.println(nyu) ;

	}
} Main

import java.util.*;
public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
  //    String[] nyu=sc.nextLine().split(" ");

     String nyu=sc.nextLine();
//int[] num=new int[6];
//int A=Integer.parseInt(nyu[0]);
//int B=Integer.parseInt(nyu[1]);
//int C=Integer.parseInt(nyu);
//double A=Double.parseDouble(nyu[0]);
//double B=Double.parseDouble(nyu[1]);
/*
switch(C){
case 7:
case 5:
case 3:
System.out.println("YES") ;
break;
default:
System.out.println("NO") ;

break;
}
*/

nyu=nyu.replaceAll("1","e");
nyu=nyu.replaceAll("9","g");
nyu=nyu.replaceAll("e","9");
nyu=nyu.replaceAll("g","1");


System.out.println(nyu) ;

	}
}