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;
using ll = long long int;
int gcd(int n, int m) {
  if (m == 0) return n;
  return gcd(m, n % m);
}
int lcm(int n, int m) { return n * m / gcd(n, m); }
ll fact(ll n) {
  if (n == 1 or n == 0)
    return 1;
  else
    return ((n % 1000000007) * (fact(n - 1) % 1000000007)) % 1000000007;
}
template <typename T>
T modpow(T base, T exp) {
  base %= 1000000007;
  T result = 1;
  while (exp > 0) {
    if (exp & 1) (result *= base) %= 1000000007;
    (base *= base) %= 1000000007;
    exp >>= 1;
  }
  return result;
}
int bin_search(vector<int>& a, int ele) {
  int lo = 0, hi = a.size() - 1;
  while (lo <= hi) {
    int mid = lo + (hi - lo) / 2;
    if (mid == 0 or mid == a.size() - 1)
      return mid;
    else if (a[mid] >= ele and a[mid - 1] < ele)
      return mid;
    else if (a[mid] >= ele)
      hi = mid - 1;
    else
      lo = mid + 1;
  }
}
bool ifPrime(int n) {
  for (int i = 2; i <= sqrt(n); i++) {
    if (n % i == 0) return 0;
  }
  return 1;
}
void solve(int testno) {
  string s;
  cin >> s;
  string orig = s;
  bool no = 1;
  for (char& c : s) {
    if (c == '9' and no) {
      no = 0;
      continue;
    }
    no = 0;
    if (c - '0' >= 5) {
      c = '0' + ('9' - c);
    }
  }
  cout << s;
}
int32_t main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin.exceptions(ios::badbit | ios::failbit);
  int t = 1;
  for (int i = 1; i <= t; i++) {
    solve(i);
  }
  return 0;
}