func_code_string: #include <bits/stdc++.h>   using namespace std;   const int MAXN = 1005;   char mp[MAXN][MAXN];   int ansmp[MAXN][MAXN];   int dire[4][2] = {0, -1, 0, 1, -1, 0, 1, 0};   int n, m;   void fillansmap(int x0, int y0, int x1, int y1) {     bool colorflag[5];     int dx = (x1 - x0 > 0);     int dy = (y1 - y0 > 0);     int dcolor;     for (int i = 1; i <= 4; i++) colorflag[i] = true;     for (int x = x0, y = y0; x <= x1 && y <= y1; x += dx, y += dy) {       for (int i = 0; i < 4; i++) {         int xx = x + dire[i][0];         int yy = y + dire[i][1];         if (0 <= xx && xx < n && 0 <= yy && yy < m)           colorflag[ansmp[xx][yy]] = false;       }     }     for (int i = 1; i <= 4; i++)       if (colorflag[i]) {         dcolor = i;         break;       }     for (int x = x0, y = y0; x <= x1 && y <= y1; x += dx, y += dy)       ansmp[x][y] = dcolor, mp[x][y] =  . ;     return;   }   bool CheckMap() {     for (int i = 0; i < n; i++)       for (int j = 0; j < m; j++)         if (mp[i][j] !=  . ) return false;     return true;   }   int main() {     bool ansflag = true;     scanf( %d%d , &n, &m);     for (int i = 0; i < n; i++) scanf( %s , mp[i]);     for (int i = 0; i < n; i++)       for (int j = 0; j < m; j++)         if (mp[i][j] ==  b ) {           if (i > 0 && mp[i - 1][j] ==  w  && i < n - 1 && mp[i + 1][j] ==  w )             fillansmap(i - 1, j, i + 1, j);           else if (j > 0 && mp[i][j - 1] ==  w  && j < m - 1 &&                    mp[i][j + 1] ==  w )             fillansmap(i, j - 1, i, j + 1);         }     if (CheckMap()) {       printf( YES n );       for (int i = 0; i < n; i++) {         for (int j = 0; j < m; j++)           if (ansmp[i][j] == 0)             printf( . );           else             printf( %c , ansmp[i][j] - 1 +  a );         printf(  n );       }     } else       printf( NO n );     return 0;   }   