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
## グリッドに関する処理
# ABC075B_Minesweeper

## 考え方：pandasに入れて、df.ilocによる行×列のスライスでうまくやる

## for test
# # 1
# height, width = 3, 5
# _s_list = ['.....', '.#.#.', '.....']

# # 2
# height, width = 3, 5
# _s_list = ['#####', '#####', '#####']

# 3
# height, width = 6, 6
# _s_list = ['#####.', '#.#.##', '####.#', '.#..#.', '#.##..', '#.#...']


## for submit
import pandas as pd
height, width = map(int, input().split())
_s_list = [input() for i in range(height)]
s_list = [list(ss) for ss in _s_list]  # 列×行に1文字ずつ区切ってリストへ追加

df = pd.DataFrame(s_list)
# print(df.iloc[0:3, 0:3])  # debug 行×列のスライス # マイナスはNG, 要素数を超えるのは問題なし
# print(df.iloc[0:3, 1:4])  # debug 行×列のスライス 3*5 から、2行目3列目の周囲を取得する

ans_list = []
for _h in range(height):
    for _w in range(width):
        # 周囲1マスずつを取得
        if _h <= 1:
            h_s = 0
        else:
            h_s = _h-1
        # h_e = _h + 2  # 一応、範囲外アクセスしないように修正
        if _h == height-1:
            h_e = _h+1
        else:
            h_e = _h+2
        
        if _w <= 1:
            w_s = 0
        else:
            w_s = _w - 1
        # w_e = _w + 2  # 一応、範囲外アクセスしないように修正
        if _w == width-1:
            w_e = _w+1
        else:
            w_e = _w+2
        
        # print(df.iloc[h_s:h_e, w_s:w_e]) # debug
        # 周囲1マスずつから、#の数を数えるための前処理
        df_bool = (df.iloc[h_s:h_e, w_s:w_e] == '#')
        # PythonでTrueは1、Falseは0とみなされるため、bool値のオブジェクトに対してsum()メソッドを呼べば条件を満たす要素の数が得られる。
        # print(str(sum(df_bool.sum())))
        
        # チェック対象の中心が#なら#, それ以外はsumした結果の数値を文字列として保存
        if df.iloc[_h, _w] == '#':
            ans_list.append('#')
        else:
            ans_list.append(str(sum(df_bool.sum())))
        
# 結果を出力 width行を1区切りとして1行ずつ出力
ans_str = ''
for i in range(len(ans_list)):
    ans_str += ans_list[i]
    if (i+1) % width == 0:
        print(ans_str)
        ans_str = ''
