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.math.BigInteger;
import java.util.Scanner;
import java.util.Stack;

/**
 * Created by sushilmainali on 15/02/15.
 */
public class Prob514A {

    public static String inverting(String n) {

        // traversing number
        //double num = n;
        BigInteger num = new BigInteger(n+"");
        BigInteger num9 = new BigInteger(9+"");
        int count = 0;
        String s = "";
        Stack<BigInteger> val = new Stack<BigInteger>();
        while(num.compareTo(BigInteger.ZERO) > 0) {

            //double temp = num % 10;
            BigInteger temp = num.mod(BigInteger.TEN);
            num = num.divide(BigInteger.TEN);
            BigInteger diff = num9.subtract(temp);

            if(num.compareTo(BigInteger.ZERO) == 0 && count == 0) {
                val.push(new BigInteger(n+"") );
            } else {
                if(temp.compareTo(diff) == 1 && diff.compareTo(BigInteger.ZERO) == 1) { // &&  (diff > 0) (temp > diff) &&  (diff > 0)

                    val.push(diff );
                } else {
                    val.push(temp );

                }

            }

            count++;


        }

        boolean isZeroFound = false;
        while(!val.isEmpty()) {
            BigInteger temp = val.pop();
            if(temp.compareTo(num9) != 0) {
                s+= temp.toString();
                isZeroFound = true;
            } else if(temp.compareTo(num9) == 0 && !isZeroFound) {

                s+= temp.toString();
                isZeroFound = true;
            } else {

                s+= (num9.subtract(temp)).toString()+"";
            }
        }


        return s;
    }

    public static void main(String... args) {

        Scanner in = new Scanner(System.in);
        String strings =in.nextLine().toString();

        System.out.println(inverting(strings));

    }

}