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;
long long int choose(long long int n, long long int m) {
  long long int ans = 0;
  long long int num = 1;
  long long int den = 1;
  for (long long int i = 0; i < m; i++) {
    num *= (n - i);
    num = num / (i + 1);
  }
  return num;
}
bool isPrime(int n) {
  if (n <= 1) return false;
  if (n <= 3) return true;
  if (n % 2 == 0 || n % 3 == 0) return false;
  for (int i = 5; i * i <= n; i = i + 6) {
    if (n % i == 0 || n % (i + 2) == 0) return false;
  }
  return true;
}
long long int gcd(long long int a, long long int b) {
  if (a == 0) {
    return b;
  } else {
    return gcd(b % a, a);
  }
}
bool sortDes(long long int i, long long int j) { return i > j; }
long long int bits(long long int n) {
  long long int count = 0;
  while (n != 0) {
    if (n % 2 != 0)
      count++;
    else
      ;
    n /= 2;
  }
  return count;
}
long long int take(long long int n) {
  long long int i;
  for (i = 2; i * i <= n; i++) {
    if (n % i == 0) {
      return i;
    }
  }
  return n;
}
int main() {
  long long int i, j, k, n, m = 0;
  string s;
  cin >> s;
  n = s.size();
  for (i = 0; i < n; i++) {
    if (s[i] - 48 < 5 || (s[i] - 48 == 9 && i == 0)) {
      continue;
    } else {
      k = s[i] - 48;
      k = 9 - k;
      s[i] = k + 48;
    }
  }
  cout << s << endl;
  return 0;
}