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 num[100], ans = 0;
int main() {
  long long x, flag = 0, i;
  scanf("%I64d", &x);
  while (x) {
    num[ans++] = x % 10;
    x /= 10;
  }
  int ca = 0;
  for (i = ans - 1; i >= 0; i--) {
    if (i == ans - 1) {
      if (9 - num[i] == 0)
        num[i] = num[i];
      else
        num[i] = min(num[i], 9 - num[i]);
      continue;
    }
    if (9 - num[i] < num[i]) num[i] = 9 - num[i];
    ca++;
  }
  for (i = ans - 1; i >= 0; i--) {
    if (num[i]) flag++;
    if (!flag && num[i] == 0) continue;
    printf("%d", num[i]);
  }
  if (!flag)
    printf("0\n");
  else
    printf("\n");
  return 0;
}