You are given an H × W grid.
The squares in the grid are described by H strings, S_1,...,S_H.
The j-th character in the string S_i corresponds to the square at the i-th row from the top and j-th column from the left (1 \leq i \leq H,1 \leq j \leq W).
`.` stands for an empty square, and `#` stands for a square containing a bomb.

Dolphin is interested in how many bomb squares are horizontally, vertically or diagonally adjacent to each empty square.
(Below, we will simply say "adjacent" for this meaning. For each square, there are at most eight adjacent squares.)
He decides to replace each `.` in our H strings with a digit that represents the number of bomb squares adjacent to the corresponding empty square.

Print the strings after the process.

Constraints

* 1 \leq H,W \leq 50
* S_i is a string of length W consisting of `#` and `.`.

Input

Input is given from Standard Input in the following format:


H W
S_1
:
S_H


Output

Print the H strings after the process.
The i-th line should contain a string T_i of length W, where the j-th character in T_i corresponds to the square at the i-th row from the top and j-th row from the left in the grid (1 \leq i \leq H, 1 \leq j \leq W).

Examples

Input

3 5
.....
.#.#.
.....


Output

11211
1#2#1
11211


Input

3 5


Output




Input

6 6
.
.#.##
.#
.#..#.
.##..
.#...


Output

3
8#7##
5#
4#65#2
5##21
4#310
#include <bits/stdc++.h>
constexpr long long MOD = 1000000007;
constexpr long double PI = 3.14159265358979323846;
const long long INF = 1e9;
const long long dx[8] = {1, 0, -1, 0, 1, -1, -1, 1};
const long long dy[8] = {0, 1, 0, -1, 1, 1, -1, -1};
long long intpow(long long a, long long n) {
  if (n == 0)
    return 1;
  else {
    for (long long i = 0; i < n - 1; i++) a *= a;
    return a;
  }
}
long long MODPOW(long long a, long long n, long long mod) {
  long long ans = 1;
  while (n > 0) {
    if (n & 1) ans = ans * a % mod;
    a = a * a % mod;
    n >>= 1;
  }
  return ans;
}
long long FACT(long long a) {
  if (a == 0)
    return 1;
  else
    return a * FACT(a - 1);
}
long long MODFACT(long long a, long long mod) {
  long long ans = 1;
  for (long long i = 1; i <= a; i++) {
    ans *= i;
    ans %= MOD;
  }
  return ans;
}
long long nPr(long long n, long long r) {
  long long s = n - r + 1;
  long long sum = 1;
  for (long long i = s; i <= n; i++) sum *= i;
  return sum;
}
long long MODnPr(long long n, long long r, long long mod) {
  long long s = n - r + 1;
  long long sum = 1;
  for (long long i = s; i <= n; i++) {
    sum *= i;
    sum = sum % MOD;
  }
  return sum;
}
long long nCr2(long long n, long long r) {
  return FACT(n) / (FACT(r) * FACT(n - r));
}
long long GCD(long long a, long long b) {
  if (a < b) (a += b, b = a - b, a -= b);
  if (b == 0) return a;
  if (a % b == 0) return b;
  return GCD(b, a % b);
}
long long LCM(long long a, long long b) { return a * b / GCD(a, b); }
long long NUMOFDIV(long long n) {
  long long ans = 0;
  for (long long i = 1; i <= n; i++) {
    if (n % i == 0) ans++;
  }
  return ans;
}
long long CEIL1(long long n) { return (n + 9) / 10 * 10; }
long long GetDigit(long long n) { return log10(n) + 1; }
long long DIGIT(long long n, long long k) {
  for (long long i = 0; i < k - 1; i++) n /= 10;
  return n % 10;
}
long long DIGITSUM(long long n) {
  long long sum = 0, dig;
  while (n) {
    dig = n % 10;
    sum += dig;
    n /= 10;
  }
  return sum;
}
long long DIVTIME(long long n, long long k) {
  long long div = 0;
  while (n % k == 0) {
    div++;
    n /= k;
  }
  return div;
}
long long binary(long long n) {
  long long ans = 0;
  for (long long i = 0; n > 0; i++) {
    ans += n % 2 * intpow(10, i);
    n /= 2;
  }
  return ans;
}
long long intabs(long long n) {
  if (n < 0)
    return -1 * n;
  else
    return n;
}
long double LOG(long long a, long long b) { return log(b) / log(a); }
long double DISTANCE(long long x1, long long y1, long long x2, long long y2) {
  return sqrt((x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2));
}
inline bool BETWEEN(long long x, long long min, long long max) {
  if (min <= x && x <= max)
    return true;
  else
    return false;
}
inline bool between(long long x, long long min, long long max) {
  if (min < x && x < max)
    return true;
  else
    return false;
}
inline bool PRIMEOR(long long x) {
  if (x == 1) return false;
  if (x == 2) return true;
  if (x % 2 == 0) return false;
  long double sqrtx = sqrt(x);
  for (long long i = 3; i <= sqrtx; i += 2) {
    if (x % i == 0) return false;
  }
  return true;
}
bool SQRTOR(long long n) {
  if (sqrt(n) == (long long)sqrt(n))
    return true;
  else
    return false;
}
using namespace std;
signed main() {
  long long H, W;
  cin >> H >> W;
  vector<string> s(W);
  for (long long i = 0; i < H; i++) cin >> s[i];
  for (long long i = 0; i < H; i++) {
    for (long long j = 0; j < W; j++) {
      if (s[i][j] == '#')
        cout << "#";
      else {
        long long num = 0;
        for (long long k = 0; k < 8; k++) {
          long long x = i + dx[k];
          long long y = j + dy[k];
          if (x >= 0 && y >= 0 && s[x][y] == '#') num++;
        }
        cout << num;
      }
    }
    cout << endl;
  }
}
