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 kadane(long long arr[], int l, int r) {
  long long maxs = arr[l];
  long long cm = arr[l];
  for (long long i = l + 1; i <= r; i++) {
    cm = max(arr[i], cm + arr[i]);
    maxs = max(maxs, cm);
  }
  return maxs;
}
void solve() {}
bool compare(pair<int, int> a, pair<int, int> b) {
  return abs(a.first - a.second) > abs(b.first - b.second);
}
bool isValid(int arr[501][501], int i, int j, int n, int m) {
  if ((i >= 0 || i <= n - 1) && (j >= 0 || j <= m - 1) && (arr[i][j] == 0))
    return true;
  return false;
}
void dfs(vector<vector<int>> tree, int u, vector<int> &depth,
         vector<bool> &visited, int d) {
  visited[u] = true;
  depth[u] = d;
  if (tree[u].size() == 0) return;
  for (int i = 0; i < tree[u].size(); i++) {
    if (!visited[tree[u][i]]) {
      dfs(tree, tree[u][i], depth, visited, d + 1);
    }
  }
}
bool cmp(int a, int b) { return a > b; }
char S[200004];
int main() {
  string S;
  cin >> S;
  int n = S.length();
  if (n == 0 && S[0] == '9') {
    cout << 0;
    return 0;
  }
  for (auto i = 0; i < n; i++) {
    int x = (int)(S[i] - '0');
    if (i == 0 && x == 9) {
      cout << 9;
      continue;
    }
    cout << min(x, 9 - x);
  }
  cout << "\n";
}