func_code_string: #include <bits/stdc++.h>   using namespace std;   int main() {     ios_base::sync_with_stdio(0);     cin.tie(0);     cout.tie(0);     int n, m;     cin >> n >> m;     char a[n + 2][m + 2];     int flag = 0;     for (long long int i = 0; i <= n + 1; i++) {       for (long long int j = 0; j <= m + 1; j++) {         a[i][j] =  . ;       }     }     for (long long int i = 1; i <= n; i++)       for (long long int j = 1; j <= m; j++) cin >> a[i][j];     for (long long int i = 1; i <= n; i++) {       for (long long int j = 1; j <= m; j++) {         if (a[i][j] ==  S ) {           if (a[i - 1][j] ==  W  || a[i + 1][j] ==  W  || a[i][j - 1] ==  W  ||               a[i][j + 1] ==  W ) {             flag = 1;             break;           }         }         if (a[i][j] ==  W ) {           if (a[i - 1][j] ==  .  || a[i - 1][j] ==  D ) a[i - 1][j] =  D ;           if (a[i + 1][j] ==  .  || a[i + 1][j] ==  D ) a[i + 1][j] =  D ;           if (a[i][j - 1] ==  .  || a[i][j - 1] ==  D ) a[i][j - 1] =  D ;           if (a[i][j + 1] ==  .  || a[i][j + 1] ==  D ) a[i][j + 1] =  D ;         }       }       if (flag == 1) break;     }     if (flag == 1)       cout <<  No             <<   n ;     else {       cout <<  Yes             <<   n ;       for (long long int i = 1; i <= n; i++) {         for (long long int j = 1; j <= m; j++) {           cout << a[i][j];         }         cout <<   n ;       }     }     return 0;   }   