func_code_string: #include <bits/stdc++.h>   using namespace std;   const int INFint = 2147483647;   const long long INF = 9223372036854775807ll;   const long long MOD = 1000000007ll;   char f[2020][2020];   int n, m;   bool c(int x, int y, int d, int cnt) {     int cur = 0;     cerr << x <<     << y << endl;     if (x > 0 && y > 0 && x + d - 1 <= n && y + d - 1 <= m) {       for (int i = x; i < x + d; i++) {         cur += (f[i][y] ==  w );         cur += (f[i][y + d - 1] ==  w );       }       for (int i = y + 1; i < y + d - 1; i++) {         cur += (f[x][i] ==  w );         cur += (f[x + d - 1][i] ==  w );       }       return (cur == cnt);     }     return 0;   }   int main() {     ios_base::sync_with_stdio(0);     int minx = INFint, miny = INFint, maxx = -INFint, maxy = -INFint;     cin >> n >> m;     int cnt = 0;     for (int i = 1; i <= n; i++) {       for (int j = 1; j <= m; j++) {         cin >> f[i][j];         if (f[i][j] ==  w ) {           minx = min(minx, i);           miny = min(miny, j);           maxx = max(maxx, i);           maxy = max(maxy, j);           cnt++;         }       }     }     int d = max(maxx - minx + 1, maxy - miny + 1);     cerr << d << endl;     if (d == 1) {       for (int it = 1; it <= n; it++) {         for (int l = 1; l <= m; l++) cout << f[it][l];         cout << endl;       }       return 0;     }     int x[3] = {minx, maxx - d + 1, 1};     int y[3] = {miny, maxy - d + 1, 1};     for (int i = 0; i < 3; i++) cerr << x[i] <<    ;     cerr << endl;     for (int i = 0; i < 3; i++) cerr << y[i] <<    ;     cerr << endl;     for (int i = 0; i < 3; i++)       for (int j = 0; j < 3; j++) {         if (c(x[i], y[j], d, cnt)) {           for (int it = x[i]; it < x[i] + d; it++) {             if (f[it][y[j]] !=  w ) f[it][y[j]] =  + ;             if (f[it][y[j] + d - 1] !=  w ) f[it][y[j] + d - 1] =  + ;           }           for (int it = y[j]; it < y[j] + d; it++) {             if (f[x[i]][it] !=  w ) f[x[i]][it] =  + ;             if (f[x[i] + d - 1][it] !=  w ) f[x[i] + d - 1][it] =  + ;           }           for (int it = 1; it <= n; it++) {             for (int l = 1; l <= m; l++) cout << f[it][l];             cout << endl;           }           return 0;         }       }     cout << -1 << endl;     fprintf(stderr,   nTIME = %lf n , 1.0 * clock() / CLOCKS_PER_SEC);     return 0;   }   