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

Solution:
#include <bits/stdc++.h>
using namespace std;
int main() {
  long long x, r, r1, s, s1, pos, pos1, nx = 0;
  int digits[19], index = 0;
  cin >> x;
  pos = 1;
  do {
    pos1 = pos;
    pos *= 10;
    r = x % pos;
    s = (x - r) / pos;
    r1 = r % pos1;
    s1 = (r - r1) / pos1;
    digits[index] = s1;
    index++;
  } while (s != 0);
  for (int i = index - 1; i >= 0; i--) {
    if (!(i == index - 1) || !(digits[i] == 9)) {
      if (digits[i] > 4) digits[i] = 9 - digits[i];
      nx = nx + digits[i] * pos1;
    } else {
      nx = nx + digits[i] * pos1;
    }
    pos1 /= 10;
  }
  cout << nx << endl;
  return 0;
}