func_code_string: #include <bits/stdc++.h>   using namespace std;   const long long MAXN = 1e3 + 10, inf = 1e18, mod = 1e9 + 7;   struct pair_hash {     template <class T1, class T2>     std::size_t operator()(const std::pair<T1, T2> &p) const {       auto h1 = std::hash<T1>{}(p.first);       auto h2 = std::hash<T2>{}(p.second);       return h1 ^ h2;     }   };   long long pw(long long te, long long tee) {     if (tee == 0) return 1;     long long res = pw(te, tee / 2);     return (tee % 2 ? te * res * res : res * res);   }   long long n;   char a[MAXN][MAXN], ans[MAXN][MAXN];   vector<pair<long long, long long>> v, t, p;   bool flag = true;   void Read_input() {     cin >> n;     for (long long i = 1; i <= n; i++)       for (long long j = 1; j <= n; j++) {         cin >> a[i][j];         if (a[i][j] ==  o ) v.push_back({i, j});         if (a[i][j] ==  x ) p.push_back({i, j});       }   }   void Solve() {     for (long long d1 = 0; d1 <= n; d1++) {       for (long long d2 = 0; d2 <= n; d2++) {         if (d1 == 0 and d2 == 0) continue;         bool f[4] = {true, true, true, true};         for (auto i : v) {           long long x = i.first + d1;           long long y = i.second + d2;           if (x <= n and y <= n and a[x][y] ==  . ) f[0] = false;           x = i.first + d1;           y = i.second - d2;           if (x <= n and y >= 1 and a[x][y] ==  . ) f[1] = false;           x = i.first - d1;           if (x >= 1 and y >= 1 and a[x][y] ==  . ) f[2] = false;           y = i.second + d2;           if (x >= 1 and y <= n and a[x][y] ==  . ) f[3] = false;         }         if (f[0]) t.push_back({d1, d2});         if (f[1]) t.push_back({d1, -d2});         if (f[2]) t.push_back({-d1, -d2});         if (f[3]) t.push_back({-d1, d2});       }     }     for (long long i = 1; i <= 2 * n - 1; i++)       for (long long j = 1; j <= 2 * n - 1; j++) ans[i][j] =  . ;     for (auto i : p) {       bool k = false;       for (auto j : t)         if (i.first - j.first >= 1 and i.second - j.second >= 1 and             a[i.first - j.first][i.second - j.second] ==  o ) {           k = true;           break;         }       if (k == false) flag = false;       if (!flag) break;     }     for (auto i : v) {       bool k = true;       for (auto j : t)         if (i.first + j.first <= n and i.second + j.second <= n and             a[i.first + j.first][i.second + j.second] ==  . ) {           k = false;           break;         }       if (k == false) flag = false;       if (!flag) break;     }     if (!flag) {       cout <<  NO ;       exit(0);     }     cout <<  YES  << endl;     ans[n][n] =  o ;     for (auto i : t)       if (n + i.first <= 2 * n - 1 and n + i.first >= 1 and           n + i.second <= 2 * n - 1 and n + i.second >= 1)         ans[n + i.first][n + i.second] =  x ;     for (long long i = 1; i <= 2 * n - 1; i++) {       for (long long j = 1; j <= 2 * n - 1; j++) cout << ans[i][j];       cout << endl;     }   }   int main() {     ios_base::sync_with_stdio(false);     cin.tie(0);     cout.tie(0);     Read_input(), Solve();     return 0;   }   