output_description: 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).
  
  * * *
input_description: Input is given from Standard Input in the following format:
  
      
      
      H W
      S_1
      :
      S_H
attempt: H,W = map(int,input().split())
  grid = [[0]*W]*H
  for h in range(H):
    row = input.split()
    for w,r in enumerate(row):
      if r == "#":
        if h>=1:
          grid[h-1][w] += 1
          if w>=1:
            grid[h-1][w-1] += 1
          if w<=W-1:
            grid[h-1][w+1] += 1
        if h<=H-1:
          grid[h+1][w] += 1
          if w>=1:
            grid[h+1][w-1] += 1
          if w<=W-1:
            grid[h+1][w+1] += 1
        if w>=1:
          grid[h][w-1] +=1
        if w<=W-1:
          grid[h][w+1] +=1
    grid.append([0 if v == "." else "#" for v in input().split()])
  for g in grid:
    print("".join([str(v) for v in g])
  
problem_description: Statement
  
  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.
samples: [{"input": "3 5\n    .....\n    .#.#.\n    .....", "output": "11211\n    1#2#1\n    11211\n    \n\nFor example, let us observe the empty square at the first row from the top and\nfirst column from the left.  \nThere is one bomb square adjacent to this empty square: the square at the\nsecond row and second column.  \nThus, the `.` corresponding to this empty square is replaced with `1`.\n\n* * *"}, {"input": "3 5\n    #####\n    #####\n    #####", "output": "#####\n    #####\n    #####\n    \n\nIt is possible that there is no empty square.\n\n* * *"}, {"input": "6 6\n    #####.\n    #.#.##\n    ####.#\n    .#..#.\n    #.##..\n    #.#...", "output": "#####3\n    #8#7##\n    ####5#\n    4#65#2\n    #5##21\n    #4#310"}]