Problem: Luke Skywalker gave Chewbacca an integer number x. Chewbacca isn't good at numbers but he loves inverting digits in them. Inverting digit t means replacing it with digit 9 - t. 

Help Chewbacca to transform the initial number x to the minimum possible positive number by inverting some (possibly, zero) digits. The decimal representation of the final number shouldn't start with a zero.

Input

The first line contains a single integer x (1 ≤ x ≤ 1018) — the number that Luke Skywalker gave to Chewbacca.

Output

Print the minimum possible positive number that Chewbacca can obtain after inverting some digits. The number shouldn't contain leading zeroes.

Examples

Input

27


Output

22


Input

4545


Output

4444

Solution (in JAVA):

Solution:
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.*;

public class CSES{
    static long mod = 1000000007;
    static class Pair implements Comparable<Pair>
    {
        long f; long s;
        Pair(long f, long s){this.f = f;this.s = s;}
        public int compareTo(Pair b){return Long.compare(this.s,b.s);}
    }
    static List<Long> check(long v){
        List<Long> l = new ArrayList<>();
        for(long i=1;i*(long)i<=v;i++){
            if(v%i==0){
                l.add(i);
                if(i!=v/i)l.add(v/i);
            }
        }
        return l;
    }

    public static void main(String[] args) throws IOException {
        FastScanner s=new FastScanner();
//        int t1 = s.nextInt();
        int t1 =1;
        while(t1-->0){
            char[] a = s.next().toCharArray();
            StringBuilder se = new StringBuilder("");
            int j=0;
            for(char i:a){
                int v = i-'0';
//                System.out.println(v);
                if(v<=4)se.append(v);
                else {
                    if(j==0 && v==9)se.append(9);
                    else  se.append(9-v);
                }
                j++;
            }
            System.out.println(se);


        }
    }

    static long gcd(long a, long b)throws IOException{return (b==0)?a:gcd(b,a%b);}
    static int gcd(int a, int b)throws IOException{return (b==0)?a:gcd(b,a%b);}
    static void sort(int[] a,int n) {
        ArrayList<Integer> l=new ArrayList<>();
        for (int i=0;i<n;i++) l.add(a[i]);
        Collections.sort(l);
        for (int i=0; i<n; i++) a[i]=l.get(i);
    }
    static void sort(int[] a) {
        ArrayList<Integer> l=new ArrayList<>();
        for (int i:a) l.add(i);
        Collections.sort(l);
        for (int i=0; i<a.length; i++) a[i]=l.get(i);
    }
    static void sort(long[] a) {
        ArrayList<Long> l=new ArrayList<>();
        for (long i:a) l.add(i);
        Collections.sort(l);
        for (int i=0; i<a.length; i++) a[i]=l.get(i);
    }
    static class FastScanner {
        BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
        StringTokenizer st=new StringTokenizer("");
        String next() {
            while (!st.hasMoreTokens())
                try {
                    st=new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            return st.nextToken();
        }

        int nextInt() {
            return Integer.parseInt(next());
        }
        int[] readArray(int n) {
            int[] a=new int[n];
            for (int i=0; i<n; i++) a[i]=nextInt();
            return a;
        }
        long nextLong() {
            return Long.parseLong(next());
        }
    }
}