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 PYTHON3):

Solution:
#!/usr/bin/env python3
"""
Codeforces
514 A. Chewbaсca and Number

@author yamaton
@date 2015-08-04
"""
import functools


def integerdigits(n):
    """Construct list of decimal digits from the integer n

    >>> integerdigits(235)
    [2, 3, 5]
    """
    return [int(i) for i in str(n)]


def fromdigits(xs):
    """Constructs an integer from the list of decimal digits.

    >>> fromdigits([1, 9, 4, 2])
    1942
    """
    return functools.reduce(lambda i, j: 10 * i + j, xs)


def solve(x):
    def _invert(k):
        return k if k < 5 else (9 - k)

    digits = integerdigits(x)
    if digits[0] == 9:
        return fromdigits([9] + [_invert(d) for d in digits[1:]])
    else:
        return fromdigits(map(_invert, digits))


def main():
    x = int(input())
    result = solve(x)
    print(result)


if __name__ == '__main__':
    main()