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.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.util.StringTokenizer;

public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader291_A in = new InputReader291_A(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        
        String p = in.next();
        String s = "";
        for (int i = 0; i < p.length(); i++) {
            if (i == 0 && Integer.parseInt(p.charAt(i)+"") == 9) {
                s += p.charAt(i);
                continue;
            }
            if (Integer.parseInt(p.charAt(i) + "") >= 5) {
                s += (9-Integer.parseInt(p.charAt(i)+""));
            }
            else {
                s += p.charAt(i);
            }
        }
        out.print(s);
        out.flush();

    }
}
class InputReader291_A {
    public BufferedReader reader;
    public StringTokenizer tokenizer;

    public InputReader291_A(InputStream stream) {
        reader = new BufferedReader(new InputStreamReader(stream), 32768);
        tokenizer = null;
    }

    public String next(){
        while (tokenizer == null || !tokenizer.hasMoreTokens()) {
            try {
                tokenizer = new StringTokenizer(reader.readLine());
            } catch (IOException e) {
                throw new RuntimeException(e);
            }
        }
        return tokenizer.nextToken();
    }

    public int nextInt() {
        return Integer.parseInt(next());
    }
    public long nextLong(){
        return Long.parseLong(next());
    }
    public double nextDouble(){
        return Double.parseDouble(next());
    }

}