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.awt.List;
import java.math.BigInteger;
import java.math.MathContext;
import java.sql.Time;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Locale;
import java.util.Scanner;

import javax.swing.DefaultListModel;


public class MainTest
{
    static void print(int a[])
    {
        for(int i=0;i<a.length;i++) System.out.print(a[i]+" ");
        System.out.println();
    }
    static void print(int a[][])
    {
        for(int i=0; i<a.length;i++) print(a[i]);
    }
    static void print(long a[])
    {
        for(int i=0;i<a.length;i++) System.out.print(a[i]+" ");
        System.out.println();
    }
    static void println(int a[])
    {
        for(int i=0;i<a.length;i++) System.out.println(a[i]+" ");
    }
    
    static int sum(int []a)
    {
        int res=0;
        for(int i=0;i<a.length;i++) res+=a[i];
        return res;
    }
    static long[] getSimple(int from,int to)
    {
        long a[]=new long[to-from];
        for(int i=0;i<a.length;i++) a[i]=from+i;
        //print(a);
        int sum=0;
        for(int i=0;i<a.length;i++)
        {
            if(a[i]>0)
            {
                for(int j=i+1;j<a.length;j++) if(a[j]%a[i]==0) a[j]=0;
                sum++;
            }
        }
        long b[]=new long[sum];
        sum=0;
        for(int i=0;i<a.length;i++) if(a[i]>0) {b[sum]=a[i]; sum++;}
        //System.out.println("SIMPLE!");
        print(b);
        return b;
    }
    static int check(int a)
    {
        if(a==1) return 0;
        else return 1;
    }
    static int[] inverse(int []a, int x,int y)
    {
        int b[]=new int[a.length];
        for(int i=0;i<a.length;i++)
        {
            if(i>=x&&i<=y)
            {
                if(a[i]==1) b[i]=0;
                else b[i]=1;
                continue;
            }
            b[i]=a[i];
        }
        return b;
    }
    static long sum(long a)
    {
        long res=0;
        for(int i=1;i<=a;i++) res+=i;
        return res;
    }
    static void charToInt()
    {
        for(int i=0;i<256;i++) System.out.println(i+":"+(char)i);
    }
    //static int a[];
    public static void main(String args[])
    {
        Scanner in=new Scanner(System.in);
        String str=in.next();
        String res="";
        for(int i=0;i<str.length();i++)
        {
            if(i==0&&str.charAt(i)=='9') {res+="9"; continue;}
            else
            {
                //System.out.println(str.substring(i, i+1));
                if(new Integer(str.substring(i,i+1))>4) res+=(9-new Integer(str.substring(i,i+1)));
                else res+=str.substring(i, i+1);
                //System.out.println(res);
            }
        }
        System.out.println(res);
    }
    
}