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.*;
import java.util.ArrayList;
import java.util.List;

public class Task514A {

    public static void main(String... args) throws NumberFormatException,
            IOException {
        Solution.main(System.in, System.out);
    }

    static class Scanner {

        private final BufferedReader br;
        private String[] cache;
        private int cacheIndex;

        Scanner(InputStream is) {
            br = new BufferedReader(new InputStreamReader(is));
            cache = new String[0];
            cacheIndex = 0;
        }

        int nextInt() throws IOException {
            if (cacheIndex >= cache.length) {
                cache = br.readLine().split(" ");
                cacheIndex = 0;
            }
            return Integer.parseInt(cache[cacheIndex++]);
        }

        long nextLong() throws IOException {
            if (cacheIndex >= cache.length) {
                cache = br.readLine().split(" ");
                cacheIndex = 0;
            }
            return Long.parseLong(cache[cacheIndex++]);
        }

        String next() throws IOException {
            if (cacheIndex >= cache.length) {
                cache = br.readLine().split(" ");
                cacheIndex = 0;
            }
            return cache[cacheIndex++];
        }

        void close() throws IOException {
            br.close();
        }

    }

    static class Solution {

        public static void main(InputStream is, OutputStream os)
                throws NumberFormatException, IOException {
            PrintWriter pw = new PrintWriter(os);
            Scanner sc = new Scanner(is);

            String n = sc.next();

            boolean wasNotZero = false;

            for(char c : n.toCharArray()){
                switch (c){
                    case '0':
                        pw.print("0");
                        break;
                    case '1':
                        pw.print("1");
                        wasNotZero = true;
                        break;
                    case '2':
                        pw.print("2");
                        wasNotZero = true;
                        break;
                    case '3':
                        pw.print("3");
                        wasNotZero = true;
                        break;
                    case '4':
                        pw.print("4");
                        wasNotZero = true;
                        break;
                    case '5':
                        pw.print("4");
                        wasNotZero = true;
                        break;
                    case '6':
                        pw.print("3");
                        wasNotZero = true;
                        break;
                    case '7':
                        pw.print("2");
                        wasNotZero = true;
                        break;
                    case '8':
                        pw.print("1");
                        wasNotZero = true;
                        break;
                    case '9':
                        if(wasNotZero){
                            pw.print("0");
                        } else {
                            pw.print("9");
                            wasNotZero = true;
                        }

                        break;
                }
            }


            pw.println();

            pw.flush();
            sc.close();
        }
    }

}