//\\..........torque.............\\//
#include <bits/stdc++.h>
using namespace std;
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#define fast ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)

using namespace __gnu_pbds;
#define ordered_set tree<int, null_type,less<int>, rb_tree_tag,tree_order_statistics_node_update>
//find_by_order(k): It returns to an iterator to the kth element (counting from zero) in the set
//order_of_key(k) : It returns to the number of items that are strictly smaller than our item k
#define pb push_back
#define f first
#define s second
#define F(i,a,b) for(i=a;i<b;i++)
#define nl   "\n"
#define sp   " "
#define all(c) (c).begin(),(c).end()
#define fast_cin() ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL)

typedef long double ld;
typedef long long   ll;
typedef vector<ll>  vll;
typedef vector<pair<ll,ll>> vpll;
#define    cty  cout<<"YES"<<nl
#define ctn   cout<<"NO"<<nl
#define   lmax  LLONG_MAX
#define   lmin  LLONG_MIN
// priority_queue<t>

ll powm(ll a, ll b) {
	ll res=1;
	while(b) {
		if(b&1)
			res=(res*a);
		a=(a*a);
		b>>=1;
	}
	return res;
}

void solve()
{ ll i,j,x,y,z,k,d,r,h,c,n,m,cnt;
 cin>>n;
 set<pair<ll,ll>>s;
 vpll pc;
 char a[n][n];
 F(i,0,n)
     F(j,0,n)
 {cin>>a[i][j];
     if(a[i][j]=='o')
         pc.pb({i,j});}

 F(i,0,n)
     F(j,0,n){
     if(a[i][j]=='x')
     {
         for(auto u:pc)
         s.insert({i-u.f,j-u.s});

     }
 }
 vpll ans;
 //cout<<pc.size()<<nl;
 for(auto u:s)
 {
     x=u.f,y=u.s;
     bool flag=1;
  for(auto h:pc)
  {
      if(x+h.f<=n-1&&x+h.f>=0&&y+h.s<=n-1&&y+h.s>=0)
          if(a[x+h.f][y+h.s]=='.')
      {flag=0;
       break;
      }
  }
     if(flag)
         ans.pb({x,y});

 }
 ll fr[n][n]={0};

 for(auto u:pc)
 {x=u.f,y=u.s;

  for(auto h:ans){
     if(x+h.f<=n-1&&x+h.f>=0&&y+h.s<=n-1&&y+h.s>=0)
         fr[x+h.f][y+h.s]=1;

  }

 }
 F(i,0,n)
     F(j,0,n)
       if(a[i][j]=='x'&&fr[i][j]==0)
 {ctn;

  return;
 }
 cty;
 char zor[2*n-1][2*n-1];
 m=2*n-1;
 F(i,0,m)
      F(j,0,m)
       zor[i][j]='.';
 zor[m/2][m/2]='o';
 x=m/2,y=m/2;
 for(auto h:ans){
     if(x+h.f<=m-1&&x+h.f>=0&&y+h.s<=m-1&&y+h.s>=0)
         zor[x+h.f][y+h.s]='x';

 }
 F(i,0,m){
     F(j,0,m)
      cout<<zor[i][j];
 cout<<nl;}
};
int main()
{fast;
    int t;
t=1;
//cin >>t;
 while(t--)
     solve();
}


//\\..........torque.............\\//
#include <bits/stdc++.h>
using namespace std;
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#define fast ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)

using namespace __gnu_pbds;
#define ordered_set tree<int, null_type,less<int>, rb_tree_tag,tree_order_statistics_node_update>
//find_by_order(k): It returns to an iterator to the kth element (counting from zero) in the set
//order_of_key(k) : It returns to the number of items that are strictly smaller than our item k
#define pb push_back
#define f first
#define s second
#define F(i,a,b) for(i=a;i<b;i++)
#define nl   "\n"
#define sp   " "
#define all(c) (c).begin(),(c).end()
#define fast_cin() ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL)

typedef long double ld;
typedef long long   ll;
typedef vector<ll>  vll;
typedef vector<pair<ll,ll>> vpll;
#define    cty  cout<<"YES"<<nl
#define ctn   cout<<"NO"<<nl
#define   lmax  LLONG_MAX
#define   lmin  LLONG_MIN
// priority_queue<t>

ll powm(ll a, ll b) {
	ll res=1;
	while(b) {
		if(b&1)
			res=(res*a);
		a=(a*a);
		b>>=1;
	}
	return res;
}

void solve()
{ ll i,j,x,y,z,k,d,r,h,c,n,m,cnt;
 cin>>n;
 set<pair<ll,ll>>s;
 vpll pc;
 char a[n][n];
 F(i,0,n)
     F(j,0,n)
 {cin>>a[i][j];
     if(a[i][j]=='o')
         pc.pb({i,j});}

 F(i,0,n)
     F(j,0,n){
     if(a[i][j]=='x')
     {
         for(auto u:pc)
         s.insert({i-u.f,j-u.s});

     }
 }
 vpll ans;
 //cout<<pc.size()<<nl;
 for(auto u:s)
 {
     x=u.f,y=u.s;
     bool flag=1;
  for(auto h:pc)
  {
      if(x+h.f<=n-1&&x+h.f>=0&&y+h.s<=n-1&&y+h.s>=0)
          if(a[x+h.f][y+h.s]=='.')
      {flag=0;
       break;
      }
  }
     if(flag)
         ans.pb({x,y});

 }
 ll fr[n][n];
 F(i,0,n)
     F(j,0,n)
       fr[i][j]=0;

 for(auto u:pc)
 {x=u.f,y=u.s;

  for(auto h:ans){
     if(x+h.f<=n-1&&x+h.f>=0&&y+h.s<=n-1&&y+h.s>=0)
         fr[x+h.f][y+h.s]=1;

  }

 }
 F(i,0,n)
     F(j,0,n)
       if(a[i][j]=='x'&&fr[i][j]==0)
 {ctn;

  return;
 }
 cty;
 char zor[2*n-1][2*n-1];
 m=2*n-1;
 F(i,0,m)
      F(j,0,m)
       zor[i][j]='.';
 zor[m/2][m/2]='o';
 x=m/2,y=m/2;
 for(auto h:ans){
     if(x+h.f<=m-1&&x+h.f>=0&&y+h.s<=m-1&&y+h.s>=0)
         zor[x+h.f][y+h.s]='x';

 }
 F(i,0,m){
     F(j,0,m)
      cout<<zor[i][j];
 cout<<nl;}
};
int main()
{fast;
    int t;
t=1;
//cin >>t;
 while(t--)
     solve();
}


#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const int N=55;
char a[2*N][2*N],b[N][N];
int main()
{
	int n;
	scanf("%d",&n);
	for(int i=0;i<n;i++) scanf("%s",b[i]);
	memset(a,'x',sizeof(a));
	a[n][n]='o';
	for(int i=0;i<n;i++) for(int j=0;j<n;j++)
	if(b[i][j]=='o')
	{
		for(int i1=0;i1<n;i1++) for(int j1=0;j1<n;j1++)
		if(b[i1][j1]=='.')
		{
			a[i1-i+n][j1-j+n]='.';
		}
	}
	bool ok;
	for(int i=0;i<n;i++) for(int j=0;j<n;j++) if(b[i][j]=='x')
	{
		ok=false;
		for(int i1=0;i1<n;i1++) for(int j1=0;j1<n;j1++) if(b[i1][j1]=='o')
		{
			if(a[i-i1+n][j-j1+n]=='x') ok=true;
		}
		if(!ok) {printf("NO\n");return 0;}
	}
	printf("YES\n");
	for(int i=1;i<2*n;i++) {for(int j=1;j<2*n;j++) printf("%c",a[i][j]);printf("\n");}
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define FOR(x, y, z) for(int x = y; x <= z; x++)
#define f first
#define s second
#define mp make_pair
#define pb push_back
#define x1 lol
#define y1 lal
#define ex exit(0)
typedef long long ll;
typedef pair<ll,ll> pii;
typedef vector<ll> vi;
int const N=(int)2e6+1,INF=(int)1e9+1, MOD=(int)1e9+7;
ll mypow(ll a, ll b, int mod) {
    ll rv = 1;
    while (b) {
        if (b % 2)
            rv = rv*a%mod;
        a = a*a %mod;
        b /= 2;
    }
    return rv;
}
bool ok,used[200][200],same;
ll n,m,ans,k,cur,cnt,pos;
char c[200][200],l[200][200];
vector<pii > v,p;
string s;
int main(){
    ios_base::sync_with_stdio(0);cin.tie(0);
    //freopen("output.txt","w",stdout);
    cin>>n;
    for(int i=1;i<=n;i++)
        for(int j=1;j<=n;j++){
            cin>>c[i][j];
            if(c[i][j]=='o')
                v.pb({i,j});
            if(c[i][j]=='x')
                cnt++;
        }
    for(int i=1;i<=n;i++)
        for(int j=1;j<=n;j++){
            if(c[i][j]=='x'){
                for(auto o:v){
                    int x=i-o.f;
                    int y=j-o.s;
                    ok=1;
                    for(auto o:v){
                        if(o.f+x<=n && o.f+x>0 && o.s+y<=n &&o.s+y>0){
                            if(c[o.f+x][o.s+y]=='.')
                                ok=0;
                        }
                    }
                    if(ok){
                        p.pb({x,y});break;
                    }
                }
            }
        }
    for(int i=1;i<=n;i++)
        for(int j=1;j<=n;j++){
            if(c[i][j]=='o')
                for(auto o:p){
                    if(c[i+o.f][j+o.s]=='x')
                        used[i+o.f][j+o.s]=1;
                }
        }
        for(int i=1;i<=n;i++)
        for(int j=1;j<=n;j++){
            if(used[i][j])
            ans++;
        }
    for(auto i:p)
        cout<<i.f<<" "<<i.s<<endl;
  //  cout<<ans;
    if(ans!=cnt)
        cout<<"NO",ex;
    cout<<"YES"<<endl;
    for(int i=1;i<=2*n-1;i++)
        for(int j=1;j<=2*n-1;j++){
            l[i][j]='.';
            if(i==n && j==n)
                l[i][j]='o';
        }
    for(auto o:p){
        l[n+o.f][n+o.s]='x';
    }
    for(int i=1;i<=2*n-1;i++){
        for(int j=1;j<=2*n-1;j++)
            cout<<l[i][j];
        cout<<endl;
    }
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define FOR(x, y, z) for(int x = y; x <= z; x++)
#define f first
#define s second
#define mp make_pair
#define pb push_back
#define x1 lol
#define y1 lal
#define ex exit(0)
typedef long long ll;
typedef pair<ll,ll> pii;
typedef vector<ll> vi;
int const N=(int)2e6+1,INF=(int)1e9+1, MOD=(int)1e9+7;
ll mypow(ll a, ll b, int mod) {
    ll rv = 1;
    while (b) {
        if (b % 2)
            rv = rv*a%mod;
        a = a*a %mod;
        b /= 2;
    }
    return rv;
}
bool ok,used[200][200],same;
ll n,m,ans,k,cur,cnt,pos;
char c[200][200],l[200][200];
vector<pii > v,p;
string s;
int main(){
    ios_base::sync_with_stdio(0);cin.tie(0);
    //freopen("output.txt","w",stdout);
    cin>>n;
    for(int i=1;i<=n;i++)
        for(int j=1;j<=n;j++){
            cin>>c[i][j];
            if(c[i][j]=='o')
                v.pb({i,j});
            if(c[i][j]=='x')
                cnt++;
        }
    for(int i=1;i<=n;i++)
        for(int j=1;j<=n;j++){
            if(c[i][j]=='x'){
                for(auto o:v){
                    int x=i-o.f;
                    int y=j-o.s;
                    ok=1;
                    for(auto o:v){
                        if(o.f+x<=n && o.f+x>0 && o.s+y<=n &&o.s+y>0){
                            if(c[o.f+x][o.s+y]=='.')
                                ok=0;
                        }
                    }
                    if(ok){
                        p.pb({x,y});break;
                    }
                }
            }
        }
    for(int i=1;i<=n;i++)
        for(int j=1;j<=n;j++){
            if(c[i][j]=='o')
                for(auto o:p){
                    if(c[i+o.f][j+o.s]=='x')
                        used[i+o.f][j+o.s]=1;
                }
        }
        for(int i=1;i<=n;i++)
        for(int j=1;j<=n;j++){
            if(used[i][j])
            ans++;
        }
 //QA   for(auto i:p)cout<<i.f<<" "<<i.s<<endl;
  //  cout<<ans;
    if(ans!=cnt)
        cout<<"NO",ex;
    cout<<"YES"<<endl;
    for(int i=1;i<=2*n-1;i++)
        for(int j=1;j<=2*n-1;j++){
            l[i][j]='.';
            if(i==n && j==n)
                l[i][j]='o';
        }
    for(auto o:p){
        l[n+o.f][n+o.s]='x';
    }
    for(int i=1;i<=2*n-1;i++){
        for(int j=1;j<=2*n-1;j++)
            cout<<l[i][j];
        cout<<endl;
    }
    return 0;
}


#include<iostream>
#include<cstring>
#include<cstdio>
#include<algorithm>
#include<cmath>
#include<set>
#include<bitset>
#include<map>

#define fo(i,a,b) for(int i=a;i<=b;i++)
#define fd(i,a,b) for(int i=a;i>=b;i--)

using namespace std;

typedef long long LL;
typedef double db;

int get(){
	char ch;
	while(ch=getchar(),(ch<'0'||ch>'9')&&ch!='-');
	if (ch=='-'){
		int s=0;
		while(ch=getchar(),ch>='0'&&ch<='9')s=s*10+ch-'0';
		return -s;
	}
	int s=ch-'0';
	while(ch=getchar(),ch>='0'&&ch<='9')s=s*10+ch-'0';
	return s;
}

const int N = 55;

int n;
char s[N][N];
int t[N*2][N*2];
bool bz[N][N];

int main(){
	freopen("data.in","r",stdin);
	n=get();
	fo(i,1,n){
		char ch;
		while(ch=getchar(),ch!='x'&&ch!='.'&&ch!='o');
		fo(j,1,n){
			s[i][j]=ch;
			ch=getchar();
		}
	}
	int q=0;
	fo(i,1,n)
		fo(j,1,n)
		if (s[i][j]=='o'){
			fo(x,-n+1,n-1)
				fo(y,-n+1,n-1){
					if (i+x<1||i+x>n||j+y<1||j+y>n){t[x+N][y+N]++;continue;}
					if (s[i+x][j+y]=='o'||s[i+x][j+y]=='x')t[x+N][y+N]++;
				}
			q++;
		}
	fo(i,1,n)
		fo(j,1,n)
		if (s[i][j]=='o')
			fo(x,-n+1,n-1)
				fo(y,-n+1,n-1)
				if (t[x+N][y+N]==q){
					if (i+x<1||i+x>n||j+y<1||j+y>n)continue;
					bz[i+x][j+y]=1;
				}
	bool ans=0;
	fo(i,1,n)
		fo(j,1,n)
		if ((s[i][j]=='x'&&!bz[i][j])||(s[i][j]=='.'&&bz[i][j]))ans=1;
	if (ans)printf("NO\n");
	else{
		printf("YES\n");
		fo(x,-n+1,n-1){
			fo(y,-n+1,n-1){
				if (x==0&&y==0){putchar('o');continue;}
				if (t[x+N][y+N]==q){putchar('x');continue;}
				putchar('.');
			}
			putchar('\n');
		}
	}
	return 0;
}


#include<iostream>
#include<cstring>
#include<cstdio>
#include<algorithm>
#include<cmath>
#include<set>
#include<bitset>
#include<map>

#define fo(i,a,b) for(int i=a;i<=b;i++)
#define fd(i,a,b) for(int i=a;i>=b;i--)

using namespace std;

typedef long long LL;
typedef double db;

int get(){
	char ch;
	while(ch=getchar(),(ch<'0'||ch>'9')&&ch!='-');
	if (ch=='-'){
		int s=0;
		while(ch=getchar(),ch>='0'&&ch<='9')s=s*10+ch-'0';
		return -s;
	}
	int s=ch-'0';
	while(ch=getchar(),ch>='0'&&ch<='9')s=s*10+ch-'0';
	return s;
}

const int N = 55;

int n;
char s[N][N];
int t[N*2][N*2];
bool bz[N][N];

int main(){
	n=get();
	fo(i,1,n){
		char ch;
		while(ch=getchar(),ch!='x'&&ch!='.'&&ch!='o');
		fo(j,1,n){
			s[i][j]=ch;
			ch=getchar();
		}
	}
	int q=0;
	fo(i,1,n)
		fo(j,1,n)
		if (s[i][j]=='o'){
			fo(x,-n+1,n-1)
				fo(y,-n+1,n-1){
					if (i+x<1||i+x>n||j+y<1||j+y>n){t[x+N][y+N]++;continue;}
					if (s[i+x][j+y]=='o'||s[i+x][j+y]=='x')t[x+N][y+N]++;
				}
			q++;
		}
	fo(i,1,n)
		fo(j,1,n)
		if (s[i][j]=='o')
			fo(x,-n+1,n-1)
				fo(y,-n+1,n-1)
				if (t[x+N][y+N]==q){
					if (i+x<1||i+x>n||j+y<1||j+y>n)continue;
					bz[i+x][j+y]=1;
				}
	bool ans=0;
	fo(i,1,n)
		fo(j,1,n)
		if ((s[i][j]=='x'&&!bz[i][j])||(s[i][j]=='.'&&bz[i][j]))ans=1;
	if (ans)printf("NO\n");
	else{
		printf("YES\n");
		fo(x,-n+1,n-1){
			fo(y,-n+1,n-1){
				if (x==0&&y==0){putchar('o');continue;}
				if (t[x+N][y+N]==q){putchar('x');continue;}
				putchar('.');
			}
			putchar('\n');
		}
	}
	return 0;
}


#include <bits/stdc++.h>

using namespace std;

const int MOD=1e9+7;

//const int MOD=998244353;
int n;

bool check(int i, int j){
    return i>=0 && i<n && j>=0 && j<n;
}

int main() {
    ios_base::sync_with_stdio(0);
    cin.tie(0);

    cin>>n;
    vector<string> gr(n), gr2(n,string(n,'.'));
    for(auto&s:gr)cin>>s;

    vector<pair<int,int>> vp, vp2;
    for(int i=0; i<n; i++){
        for(int j=0; j<n; j++){
            if(gr[i][j]=='o'){
                vp.push_back({i,j});
                gr2[i][j]='o';
            }
        }
    }

    for(int i=-n+1; i<n; i++){
        for(int j=-n+1; j<n; j++){
            bool w=1;
            for(auto p:vp){
                if(check(p.first+i,p.second+j)){
                    if(gr[p.first+i][p.second+j]=='.'){
                        w=0;
                        break;
                    }
                }
            }
            if(w) vp2.push_back({i,j});
        }
    }
    for(auto p:vp){
        for(auto p2:vp2){
            int i=p.first+p2.first, j=p.second+p2.second;
            if(check(i,j)){
                if(gr2[i][j]=='.') gr2[i][j]='x';
            }
        }
    }

    for(int i=0; i<n; i++){
        if(gr2[i]!=gr[i]){
            cout<<"NO";
            return 0;
        }
    }

    vector<string> ans(2*n-1,string(2*n-1,'.'));

    for(auto p:vp2){
        ans[n-1+p.first][n-1+p.second]='x';
    }

    ans[n-1][n-1]='o';
    for(auto s:ans){
        cout<<s<<'\n';
    }

    return 0;
}


#include <bits/stdc++.h>

using namespace std;

const int MOD=1e9+7;

//const int MOD=998244353;
int n;

bool check(int i, int j){
    return i>=0 && i<n && j>=0 && j<n;
}

int main() {
    ios_base::sync_with_stdio(0);
    cin.tie(0);

    cin>>n;
    vector<string> gr(n), gr2(n,string(n,'.'));
    for(auto&s:gr)cin>>s;

    vector<pair<int,int>> vp, vp2;
    for(int i=0; i<n; i++){
        for(int j=0; j<n; j++){
            if(gr[i][j]=='o'){
                vp.push_back({i,j});
                gr2[i][j]='o';
            }
        }
    }

    for(int i=-n+1; i<n; i++){
        for(int j=-n+1; j<n; j++){
            bool w=1;
            for(auto p:vp){
                if(check(p.first+i,p.second+j)){
                    if(gr[p.first+i][p.second+j]=='.'){
                        w=0;
                        break;
                    }
                }
            }
            if(w) vp2.push_back({i,j});
        }
    }
    for(auto p:vp){
        for(auto p2:vp2){
            int i=p.first+p2.first, j=p.second+p2.second;
            if(check(i,j)){
                if(gr2[i][j]=='.') gr2[i][j]='x';
            }
        }
    }

    for(int i=0; i<n; i++){
        if(gr2[i]!=gr[i]){
            cout<<"NO";
            return 0;
        }
    }

    vector<string> ans(2*n-1,string(2*n-1,'.'));

    for(auto p:vp2){
        ans[n-1+p.first][n-1+p.second]='x';
    }

    ans[n-1][n-1]='o';
    cout<<"YES\n";
    for(auto s:ans){
        cout<<s<<'\n';
    }

    return 0;
}


/// !! Killian !! ///

#include <bits/stdc++.h>
#define Killian "538D"
#define endl "\n"
#define pii pair <int,int>
using namespace std;
mt19937_64 random_num(chrono::high_resolution_clock::now().time_since_epoch().count());
const int MOD=1000000007;
const int base=26;

int n;
char a[51][51];
char b[51][51];
char res[101][101];

int main()
{
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
//    freopen(Killian".inp","r",stdin);
//    freopen(Killian".out","w",stdout);
    cin>>n;
    for (int i=1; i<=n; i++)
        for (int j=1; j<=n; j++)
            cin>>a[i][j];
    for (int i=1; i<=n; i++)
        for (int j=1; j<=n; j++)
        {
            b[i][j]='.';
            if(a[i][j]=='o')
                b[i][j]='o';
        }
    for (int i=1; i<=n*2-1; i++)
        for (int j=1; j<=n*2-1; j++)
            res[i][j]='.';
    for(int x=-n+1; x<=n-1; x++)
        for(int y=-n+1; y<=n-1; y++)
        {
            bool check=1;
            for (int i=1; i<=n; i++)
                for (int j=1; j<=n; j++)
                {
                    if(a[i][j]!='o')
                        continue;
                    int ni=i+x,nj=j+y;
                    if (1<=ni && ni<=n && 1<=nj && nj<=n)
                        if (a[ni][nj]=='.')
                            check=0;
                }
            if(check==1)
            {
                res[n+x][n+y]='x';
                for (int i=1; i<=n; i++)
                    for (int j=1; j<=n; j++)
                    {
                        if(a[i][j]!='o')
                            continue;
                        int ni=i+x,nj=j+y;
                        if (1<=ni && ni<=n && 1<=nj && nj<=n)
                            if (b[ni][nj]=='.')
                            b[ni][nj]='x';
                    }
            }
        }
    for (int i=1; i<=n; i++)
        for (int j=1; j<=n; j++)
            if(a[i][j]!=b[i][j])
            {
                cout<<"NO"<<endl;
                return 0;
            }
    cout<<"YES"<<endl;
    res[n][n]='o';
    for (int i=1; i<=n*2-1; i++)
    {
        for (int j=1; j<=n*2-1; j++)
            cout<<res[i][j];
        cout<<endl;
    }
}


#include <bits/stdc++.h>
using namespace std;
#define mp make_pair
#define mt make_tuple
#define fi first
#define se second
#define pb push_back
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define forn(i, n) for (int i = 0; i < (int)(n); i++)
#define for1(i, n) for (int i = 1; i <= (int)(n); i++)
#define ford(i, n) for (int i = (int)(n) - 1; i >= 0; i--)
#define fore(i, a, b) for (int i = (int)(a); i < (int)(b); i++)
typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<pii> vpi;
typedef vector<vi> vvi;
typedef long long i64;
typedef vector<i64> vi64;
typedef vector<vi64> vvi64;
typedef pair<i64, i64> pi64;
typedef double ld;
void fastscan(int &number)
{
    bool negative = false;
    register int c;
    number = 0;
    c = getchar();
    if (c=='-')
    {   negative = true;
        c = getchar();
    }
    for (; (c>47 && c<58); c=getchar())
        number = number *10 + c - 48;
    if (negative)
        number *= -1;
}

int main()
{
        int n;
        cin>>n;
        vector<string> board(n);
        forn(i,n){
            cin>>board[i];
        }
        set<pair<int,int> > possib;
        vector<pair<int,int> > emp;
        vector<pair<int,int> > occ;
        vector<pair<int,int> > att;
        forn(i,n){
            forn(ii,n){
                if(i<n && ii<n){
                    possib.insert(make_pair(i,ii));
                    possib.insert(make_pair(i,-ii));
                    possib.insert(make_pair(-i,ii));
                    possib.insert(make_pair(-i,-ii));
                }

                if(board[i][ii]=='.')
                    emp.push_back(make_pair(i,ii));
                if(board[i][ii]=='x')
                    att.push_back(make_pair(i,ii));
                if(board[i][ii]=='o')
                    occ.push_back(make_pair(i,ii));
            }
        }
        forn(i,occ.size()){
            forn(ii,emp.size()){
                pair<int,int> yy=make_pair(emp[ii].first-occ[i].first,emp[ii].second-occ[i].second);
                if(possib.find(yy)!=possib.end()){
                    possib.erase(yy);
                }

            }
        }

        char verify[n][n];
        forn(i,n){
            forn(ii,n)
              verify[i][ii]='.';
        }
        forn(i,occ.size()){
            for(auto it=possib.begin();it!=possib.end();it++){
                   int a=(*it).first+occ[i].first;
                   int b=(*it).second+occ[i].second;
                   if(a>=0 && a<n && b>=0 && b<n){
                       verify[a][b]='x';
                   }

            }
        }
        forn(i,occ.size()){
           verify[occ[i].first][occ[i].second]='o';
        }
        /*forn(i,n){
            forn(ii,n)
                cout<<verify[i][ii];
            cout<<endl;
        }*/
        int qq=1;
        forn(i,n){
            forn(ii,n){
                if(verify[i][ii]!=board[i][ii]){
                    qq=0;
                    break;
                }
            }
            if(!qq)
                break;
        }
        if(!qq)
            cout<<"NO"<<endl;
        else{
            cout<<"YES"<<endl;
            char oo[(2*n)-1][(2*n)-1];
            forn(ii,(2*n)-1)
               forn(iii,(2*n)-1)
                  oo[ii][iii]='.';
            for(auto it=possib.begin();it!=possib.end();it++){
                int a=(*it).first+n-1;
                int b=(*it).second+n-1;
                oo[a][b]='x';

            }
            oo[n-1][n-1]='o';
            forn(ii,(2*n)-1) {
                forn(iii, (2 * n) - 1)cout << oo[ii][iii];
                cout << endl;
            }

        }
        return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define mp make_pair
#define mt make_tuple
#define fi first
#define se second
#define pb push_back
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define forn(i, n) for (int i = 0; i < (int)(n); i++)
#define for1(i, n) for (int i = 1; i <= (int)(n); i++)
#define ford(i, n) for (int i = (int)(n) - 1; i >= 0; i--)
#define fore(i, a, b) for (int i = (int)(a); i < (int)(b); i++)
typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<pii> vpi;
typedef vector<vi> vvi;
typedef long long i64;
typedef vector<i64> vi64;
typedef vector<vi64> vvi64;
typedef pair<i64, i64> pi64;
typedef double ld;
void fastscan(int &number)
{
    bool negative = false;
    register int c;
    number = 0;
    c = getchar();
    if (c=='-')
    {   negative = true;
        c = getchar();
    }
    for (; (c>47 && c<58); c=getchar())
        number = number *10 + c - 48;
    if (negative)
        number *= -1;
}

int main()
{
        int n,m;
        cin>>n>>m;
        vector<vector<int> > numbers;

        for(int i=0;i<m;i++){
            vector<int> p(2);
            cin>>p[0]>>p[1];
            numbers.push_back(p);
        }
        int maxh=0;
        if(numbers.size()>0){
            if(numbers[0][0]>1){
                maxh=numbers[0][0]-1+numbers[0][1];
            }
            if(numbers[numbers.size()-1][0]<n && n-numbers[numbers.size()-1][0]+numbers[numbers.size()-1][1]>maxh){
                maxh=n-numbers[numbers.size()-1][0]+numbers[numbers.size()-1][1];
            }
        }
        int pos=1;
        forn(i,m-1){
            if(abs(numbers[i][0]-numbers[i+1][0])<abs(numbers[i][1]-numbers[i+1][1])){
                pos=0;
                break;
            }
            if(numbers[i][1]<numbers[i+1][1]){
                int h1=numbers[i][1];
                fore(ii,numbers[i][0],numbers[i+1][0]+1){
                    if(h1-numbers[i+1][1]<abs(ii-numbers[i+1][0])-1){
                        h1++;
                    }
                }
                if(h1>maxh){
                    maxh=h1;
                }
            }
            else{
                int h1=numbers[i+1][1];
                for(int ii=numbers[i+1][0];ii>=numbers[i][0];ii--){
                    if(h1-numbers[i][1]<abs(ii-numbers[i][0])-1){
                        h1++;
                    }
                }
                if(h1>maxh){
                    maxh=h1;
                }
            }

        }
        if(pos){
            cout<<maxh<<endl;
        }
        else{
            cout<<"IMPOSSIBLE"<<endl;
        }
        return 0;
}


#pragma GCC optimize("O3")

#include <bits/stdc++.h>

using namespace std;

struct custom_hash {
    static uint64_t splitmix64(uint64_t x) {
        // http://xorshift.di.unimi.it/splitmix64.c
        x += 0x9e3779b97f4a7c15;
        x = (x ^ (x >> 30)) * 0xbf58476d1ce4e5b9;
        x = (x ^ (x >> 27)) * 0x94d049bb133111eb;
        return x ^ (x >> 31);
    }

    size_t operator()(uint64_t x) const {
        static const uint64_t FIXED_RANDOM = chrono::steady_clock::now().time_since_epoch().count();
        return splitmix64(x + FIXED_RANDOM);
    }
};

#define n_l '\n'
#define dbg(...) cout << "[" << #__VA_ARGS__ << "]: "; cout << to_string(__VA_ARGS__) << endl
template <typename T, size_t N> int SIZE(const T (&t)[N]){ return N; } template<typename T> int SIZE(const T &t){ return t.size(); } string to_string(const string s, int x1=0, int x2=1e9){ return '"' + ((x1 < s.size()) ? s.substr(x1, x2-x1+1) : "") + '"'; } string to_string(const char* s) { return to_string((string) s); } string to_string(const bool b) { return (b ? "true" : "false"); } string to_string(const char c){ return string({c}); } template<size_t N> string to_string(const bitset<N> &b, int x1=0, int x2=1e9){ string t = ""; for(int __iii__ = min(x1,SIZE(b)),  __jjj__ = min(x2, SIZE(b)-1); __iii__ <= __jjj__; ++__iii__){ t += b[__iii__] + '0'; } return '"' + t + '"'; } template <typename A, typename... C> string to_string(const A (&v), int x1=0, int x2=1e9, C... coords); int l_v_l_v_l = 0, t_a_b_s = 0; template <typename A, typename B> string to_string(const pair<A, B> &p) { l_v_l_v_l++; string res = "(" + to_string(p.first) + ", " + to_string(p.second) + ")"; l_v_l_v_l--; return res; } template <typename A, typename... C> string to_string(const A (&v), int x1, int x2, C... coords) { int rnk = rank<A>::value; string tab(t_a_b_s, ' '); string res = ""; bool first = true; if(l_v_l_v_l == 0) res += n_l; res += tab + "["; x1 = min(x1, SIZE(v)), x2 = min(x2, SIZE(v)); auto l = begin(v); advance(l, x1); auto r = l; advance(r, (x2-x1) + (x2 < SIZE(v))); for (auto e = l; e != r; e = next(e)) { if (!first) { res += ", "; } first = false; l_v_l_v_l++; if(e != l){ if(rnk > 1) { res += n_l; t_a_b_s = l_v_l_v_l; }; } else{ t_a_b_s = 0; } res += to_string(*e, coords...); l_v_l_v_l--; } res += "]"; if(l_v_l_v_l == 0) res += n_l; return res; } void dbgm(){;} template<typename Heads, typename... Tails> void dbgm(Heads H, Tails... T){ cout << to_string(H) << " | "; dbgm(T...); }
#define dbgm(...) cout << "[" << #__VA_ARGS__ << "]: "; dbgm(__VA_ARGS__); cout << endl

#define REP(i,b) for(int i=0;i<(b);i++)
#define PER(i,a,b) for(int i=(a);i>(b);i++)
#define SZ(a) int((a).size())
#define ALL(a) (a).begin(), (a).end()
#define MS(s) memset(s, 0, sizeof(s))
#define IN(t, x) (t.find(x) != t.end())
#define PB push_back
#define MP make_pair
#define VI vector<int>

typedef vector<pair<int, int>> VPII;
typedef pair<int, int> PII;
typedef long long ll;
typedef unsigned long long ull;
const int MOD = (int) 1e9 + 7;
string ascii_lowercase = "abcdefghijklmnopqrstuvwxyz";
string ascii_uppercase = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";

long long inv(long long a, long long b) {
    return 1 < a ? b - inv(b % a, a) * b / a : 1;
}

const ll INF = 1e6;

unordered_map<int, int, custom_hash> mp;
// unordered_map<int, unordered_map<int, int, custom_hash>, custom_hash> g;

ll gcd(ll a, ll b, ll &x, ll &y) {
    if (a == 0) {
        x = 0;
        y = 1;
        return b;
    }
    ll x1, y1;
    ll d = gcd(b % a, a, x1, y1);
    x = y1 - (b / a) * x1;
    y = x1;
    return d;
}

ll distsq(ll x1, ll y1, ll x2, ll y2) {
    return (x2-x1)*(x2-x1) + (y2-y1)*(y2-y1);
}

ll n, m;

ll k, q;
vector<string> board;
int ret[105][105];

int main() {
    cin >> n;
    string tmp;
    MS(ret);
    REP(i, n) {
        cin >> tmp;
        board.PB(tmp);
    }
    int mid = n-1; // n-1 then center then n-1
    REP(i, n) REP(j, n) {
        if (board[i][j] == '.') {
            REP(ii, n) REP(jj, n) {
                if (board[ii][jj] == 'o') {
                    ret[i-ii + mid][j-jj + mid] = -1;
                }
            }
        }
    }
    // dbg(ret);
    REP(i, n) REP(j, n) {
        if (board[i][j] == 'x') {
            bool found = false;
            REP(ii, n) REP(jj, n) {
                if (ii == i && jj == j) continue;
                if (ret[i-ii+mid][j-jj+mid] != -1 && board[ii][jj] == 'o') {
                    found = true; break;
                }
            }
            if (!found) {
                puts("NO");
                return 0;
            }
        }
    }
    puts("YES");
    REP(i, 2*n-1) {
        REP(j, 2*n-1) {
            if (i == mid && j == mid) { printf("o"); continue; }
            printf("%c", ret[i][j] != -1 ? 'x' : '.');
        }
        printf("\n");
    }

    return 0;
}


#pragma GCC optimize("O3")

#include <bits/stdc++.h>

using namespace std;

struct custom_hash {
    static uint64_t splitmix64(uint64_t x) {
        // http://xorshift.di.unimi.it/splitmix64.c
        x += 0x9e3779b97f4a7c15;
        x = (x ^ (x >> 30)) * 0xbf58476d1ce4e5b9;
        x = (x ^ (x >> 27)) * 0x94d049bb133111eb;
        return x ^ (x >> 31);
    }

    size_t operator()(uint64_t x) const {
        static const uint64_t FIXED_RANDOM = chrono::steady_clock::now().time_since_epoch().count();
        return splitmix64(x + FIXED_RANDOM);
    }
};

#define n_l '\n'
#define dbg(...) cout << "[" << #__VA_ARGS__ << "]: "; cout << to_string(__VA_ARGS__) << endl
template <typename T, size_t N> int SIZE(const T (&t)[N]){ return N; } template<typename T> int SIZE(const T &t){ return t.size(); } string to_string(const string s, int x1=0, int x2=1e9){ return '"' + ((x1 < s.size()) ? s.substr(x1, x2-x1+1) : "") + '"'; } string to_string(const char* s) { return to_string((string) s); } string to_string(const bool b) { return (b ? "true" : "false"); } string to_string(const char c){ return string({c}); } template<size_t N> string to_string(const bitset<N> &b, int x1=0, int x2=1e9){ string t = ""; for(int __iii__ = min(x1,SIZE(b)),  __jjj__ = min(x2, SIZE(b)-1); __iii__ <= __jjj__; ++__iii__){ t += b[__iii__] + '0'; } return '"' + t + '"'; } template <typename A, typename... C> string to_string(const A (&v), int x1=0, int x2=1e9, C... coords); int l_v_l_v_l = 0, t_a_b_s = 0; template <typename A, typename B> string to_string(const pair<A, B> &p) { l_v_l_v_l++; string res = "(" + to_string(p.first) + ", " + to_string(p.second) + ")"; l_v_l_v_l--; return res; } template <typename A, typename... C> string to_string(const A (&v), int x1, int x2, C... coords) { int rnk = rank<A>::value; string tab(t_a_b_s, ' '); string res = ""; bool first = true; if(l_v_l_v_l == 0) res += n_l; res += tab + "["; x1 = min(x1, SIZE(v)), x2 = min(x2, SIZE(v)); auto l = begin(v); advance(l, x1); auto r = l; advance(r, (x2-x1) + (x2 < SIZE(v))); for (auto e = l; e != r; e = next(e)) { if (!first) { res += ", "; } first = false; l_v_l_v_l++; if(e != l){ if(rnk > 1) { res += n_l; t_a_b_s = l_v_l_v_l; }; } else{ t_a_b_s = 0; } res += to_string(*e, coords...); l_v_l_v_l--; } res += "]"; if(l_v_l_v_l == 0) res += n_l; return res; } void dbgm(){;} template<typename Heads, typename... Tails> void dbgm(Heads H, Tails... T){ cout << to_string(H) << " | "; dbgm(T...); }
#define dbgm(...) cout << "[" << #__VA_ARGS__ << "]: "; dbgm(__VA_ARGS__); cout << endl

#define REP(i,b) for(int i=0;i<(b);i++)
#define PER(i,a,b) for(int i=(a);i>(b);i++)
#define SZ(a) int((a).size())
#define ALL(a) (a).begin(), (a).end()
#define MS(s) memset(s, 0, sizeof(s))
#define IN(t, x) (t.find(x) != t.end())
#define PB push_back
#define MP make_pair
#define VI vector<int>

typedef vector<pair<int, int>> VPII;
typedef pair<int, int> PII;
typedef long long ll;
typedef unsigned long long ull;
const int MOD = (int) 1e9 + 7;
string ascii_lowercase = "abcdefghijklmnopqrstuvwxyz";
string ascii_uppercase = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";

long long inv(long long a, long long b) {
    return 1 < a ? b - inv(b % a, a) * b / a : 1;
}

const ll INF = 1e6;

unordered_map<int, int, custom_hash> mp;
// unordered_map<int, unordered_map<int, int, custom_hash>, custom_hash> g;

ll gcd(ll a, ll b, ll &x, ll &y) {
    if (a == 0) {
        x = 0;
        y = 1;
        return b;
    }
    ll x1, y1;
    ll d = gcd(b % a, a, x1, y1);
    x = y1 - (b / a) * x1;
    y = x1;
    return d;
}

ll distsq(ll x1, ll y1, ll x2, ll y2) {
    return (x2-x1)*(x2-x1) + (y2-y1)*(y2-y1);
}

ll n, m;

ll k, q;
vector<string> board;
int ret[52][52];

int main() {
    cin >> n;
    string tmp;
    MS(ret);
    REP(i, n) {
        cin >> tmp;
        board.PB(tmp);
    }
    int mid = n-1; // n-1 then center then n-1
    REP(i, n) REP(j, n) {
        if (board[i][j] == '.') {
            REP(ii, n) REP(jj, n) {
                if (board[ii][jj] == 'o') {
                    ret[i-ii + mid][j-jj + mid] = -1;
                }
            }
        }
    }
    // dbg(ret);
    REP(i, n) REP(j, n) {
        if (board[i][j] == 'x') {
            bool found = false;
            REP(ii, n) REP(jj, n) {
                if (ii == i && jj == j) continue;
                if (ret[i-ii+mid][j-jj+mid] != -1 && board[ii][jj] == 'o') {
                    found = true; break;
                }
            }
            if (!found) {
                puts("NO");
                return 0;
            }
        }
    }
    puts("YES");
    REP(i, 2*n-1) {
        REP(j, 2*n-1) {
            if (i == mid && j == mid) { printf("o"); continue; }
            printf("%c", ret[i][j] != -1 ? 'x' : '.');
        }
        printf("\n");
    }

    return 0;
}


#pragma GCC optimize("O3")

#include <bits/stdc++.h>

using namespace std;

struct custom_hash {
    static uint64_t splitmix64(uint64_t x) {
        // http://xorshift.di.unimi.it/splitmix64.c
        x += 0x9e3779b97f4a7c15;
        x = (x ^ (x >> 30)) * 0xbf58476d1ce4e5b9;
        x = (x ^ (x >> 27)) * 0x94d049bb133111eb;
        return x ^ (x >> 31);
    }

    size_t operator()(uint64_t x) const {
        static const uint64_t FIXED_RANDOM = chrono::steady_clock::now().time_since_epoch().count();
        return splitmix64(x + FIXED_RANDOM);
    }
};

#define n_l '\n'
#define dbg(...) cout << "[" << #__VA_ARGS__ << "]: "; cout << to_string(__VA_ARGS__) << endl
template <typename T, size_t N> int SIZE(const T (&t)[N]){ return N; } template<typename T> int SIZE(const T &t){ return t.size(); } string to_string(const string s, int x1=0, int x2=1e9){ return '"' + ((x1 < s.size()) ? s.substr(x1, x2-x1+1) : "") + '"'; } string to_string(const char* s) { return to_string((string) s); } string to_string(const bool b) { return (b ? "true" : "false"); } string to_string(const char c){ return string({c}); } template<size_t N> string to_string(const bitset<N> &b, int x1=0, int x2=1e9){ string t = ""; for(int __iii__ = min(x1,SIZE(b)),  __jjj__ = min(x2, SIZE(b)-1); __iii__ <= __jjj__; ++__iii__){ t += b[__iii__] + '0'; } return '"' + t + '"'; } template <typename A, typename... C> string to_string(const A (&v), int x1=0, int x2=1e9, C... coords); int l_v_l_v_l = 0, t_a_b_s = 0; template <typename A, typename B> string to_string(const pair<A, B> &p) { l_v_l_v_l++; string res = "(" + to_string(p.first) + ", " + to_string(p.second) + ")"; l_v_l_v_l--; return res; } template <typename A, typename... C> string to_string(const A (&v), int x1, int x2, C... coords) { int rnk = rank<A>::value; string tab(t_a_b_s, ' '); string res = ""; bool first = true; if(l_v_l_v_l == 0) res += n_l; res += tab + "["; x1 = min(x1, SIZE(v)), x2 = min(x2, SIZE(v)); auto l = begin(v); advance(l, x1); auto r = l; advance(r, (x2-x1) + (x2 < SIZE(v))); for (auto e = l; e != r; e = next(e)) { if (!first) { res += ", "; } first = false; l_v_l_v_l++; if(e != l){ if(rnk > 1) { res += n_l; t_a_b_s = l_v_l_v_l; }; } else{ t_a_b_s = 0; } res += to_string(*e, coords...); l_v_l_v_l--; } res += "]"; if(l_v_l_v_l == 0) res += n_l; return res; } void dbgm(){;} template<typename Heads, typename... Tails> void dbgm(Heads H, Tails... T){ cout << to_string(H) << " | "; dbgm(T...); }
#define dbgm(...) cout << "[" << #__VA_ARGS__ << "]: "; dbgm(__VA_ARGS__); cout << endl

#define REP(i,b) for(int i=0;i<(b);i++)
#define PER(i,a,b) for(int i=(a);i>(b);i++)
#define SZ(a) int((a).size())
#define ALL(a) (a).begin(), (a).end()
#define MS(s) memset(s, 0, sizeof(s))
#define IN(t, x) (t.find(x) != t.end())
#define PB push_back
#define MP make_pair
#define VI vector<int>

typedef vector<pair<int, int>> VPII;
typedef pair<int, int> PII;
typedef long long ll;
typedef unsigned long long ull;
const int MOD = (int) 1e9 + 7;
string ascii_lowercase = "abcdefghijklmnopqrstuvwxyz";
string ascii_uppercase = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";

long long inv(long long a, long long b) {
    return 1 < a ? b - inv(b % a, a) * b / a : 1;
}

const ll INF = 1e6;

unordered_map<int, int, custom_hash> mp;
// unordered_map<int, unordered_map<int, int, custom_hash>, custom_hash> g;

ll gcd(ll a, ll b, ll &x, ll &y) {
    if (a == 0) {
        x = 0;
        y = 1;
        return b;
    }
    ll x1, y1;
    ll d = gcd(b % a, a, x1, y1);
    x = y1 - (b / a) * x1;
    y = x1;
    return d;
}

ll distsq(ll x1, ll y1, ll x2, ll y2) {
    return (x2-x1)*(x2-x1) + (y2-y1)*(y2-y1);
}

ll n, m;

ll k, q;
vector<string> board;
int ret[52][52];

int main() {
    cin >> n;
    string tmp;
    MS(ret);
    REP(i, n) {
        cin >> tmp;
        board.PB(tmp);
    }
    int mid = n-1; // n-1 then center then n-1
    REP(i, n) REP(j, n) {
        if (board[i][j] == '.') {
            REP(ii, n) REP(jj, n) {
                if (board[ii][jj] == 'o') {
                    ret[i-ii + mid][j-jj + mid] = -1;
                }
            }
        }
    }
    // dbg(ret);
    REP(i, n) REP(j, n) {
        if (board[i][j] == 'x') {
            bool found = false;
            REP(ii, n) REP(jj, n) {
                if (ii == i && jj == j) continue;
                if (ret[i-ii+mid][j-jj+mid] != -1 && board[ii][jj] == 'o') {
                    found = true; break;
                }
            }
            if (!found) {
                puts("NO");
                return 0;
            }
        }
    }
    REP(i, 2*n-1) {
        REP(j, 2*n-1) {
            if (i == mid && j == mid) { printf("o"); continue; }
            printf("%c", ret[i][j] != -1 ? 'x' : '.');
        }
        printf("\n");
    }

    return 0;
}


#include <bits/stdc++.h>
using namespace std;

//TO_STRING
template <typename A, typename B>
string to_string(pair<A, B> p);

template <typename A, typename B, typename C>
string to_string(tuple<A, B, C> p);

template <typename A, typename B, typename C, typename D>
string to_string(tuple<A, B, C, D> p);

string to_string(const string& s) {
  return '"' + s + '"';
}

string to_string(char ch){
  string s;
  s += ch;
  return s;
}

string to_string(const char* s) {
  return to_string((string) s);
}

string to_string(bool b) {
  return (b ? "true" : "false");
}

string to_string(vector<bool> v) {
  bool first = true;
  string res = "{";
  for (int i = 0; i < static_cast<int>(v.size()); i++) {
    if (!first) {
      res += ", ";
    }
    first = false;
    res += to_string(v[i]);
  }
  res += "}";
  return res;
}

template <size_t N>
string to_string(bitset<N> v) {
  string res = "";
  for (size_t i = 0; i < N; i++) {
    res += static_cast<char>('0' + v[i]);
  }
  return res;
}

template <typename A>
string to_string(A v) {
  bool first = true;
  string res = "{";
  for (const auto &x : v) {
    if (!first) {
      res += ", ";
    }
    first = false;
    res += to_string(x);
  }
  res += "}";
  return res;
}

template <typename A, typename B>
string to_string(pair<A, B> p) {
  return "(" + to_string(p.first) + ", " + to_string(p.second) + ")";
}

template <typename A, typename B, typename C>
string to_string(tuple<A, B, C> p) {
  return "(" + to_string(get<0>(p)) + ", " + to_string(get<1>(p)) + ", " +
    to_string(get<2>(p)) + ")";
}

template <typename A, typename B, typename C, typename D>
string to_string(tuple<A, B, C, D> p) {
  return "(" + to_string(get<0>(p)) + ", " + to_string(get<1>(p)) + ", " +
    to_string(get<2>(p)) + ", " + to_string(get<3>(p)) + ")";
}

//DEBUG
void debug_out() { cerr << endl; }

template <typename Head, typename... Tail>
void debug_out(Head H, Tail... T) {
  cerr << " " << to_string(H);
  debug_out(T...);
}

#ifdef LOCAL //compile with -DLOCAL
#define debug(...) cerr << "[" << #__VA_ARGS__ << "]:", debug_out(__VA_ARGS__)
#else
#define debug(...) 42
#endif

typedef long long ll;
typedef long double ld;
typedef pair<int, int> pi;
typedef pair<ll, ll> pll;

typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<bool> vb;
typedef vector<pi> vpi;
typedef vector<char> vch;
typedef vector<string> vstr;
typedef vector<vi> vvi;
typedef vector<vpi> vvpi;
typedef vector<pll> vpll;
typedef vector<vll> vvll;
typedef vector<vb> vvb;
typedef vector<vvi> vvvi;
typedef vector<vch> vvch;
typedef vector<vstr> vvstr;
typedef vector<ld> vld;
typedef vector<vld> vvld;

#define all(x) x.begin(), x.end()
#define pb push_back
#define pf push_front
#define fi first
#define se second
#define sz(x) ((ll)x.size())

const int maxn = 2e5 + 5;
const ll mod = 1e9 + 7;
vll fac(maxn), invfac(maxn);

ll expmod(ll x, ll n, ll mod){
	//x ^ n % mod
	if(n == 0) return 1;
	else if(n % 2 == 0){
		ll temp = expmod(x, n / 2, mod);
		return (temp * temp) % mod;
	}
	else{
		return (expmod(x, n - 1, mod) * x) % mod;
	}
}

ll modinv(ll x, ll mod) {
	return expmod(x, mod - 2, mod);
}

void find_fac() {
	fac[0] = 1;
	invfac[0] = 1;

	for (int i = 1; i < maxn; i++) {
		fac[i] = fac[i - 1] * i % mod;
		invfac[i] = invfac[i - 1] * modinv(i, mod) % mod;
	}
}

ll C(int n, int k) {
	if (k > n) return 0;
	else {
		return fac[n] * invfac[k] % mod * invfac[n - k] % mod;
	}
}

void no() {
  cout << "NO\n";
  exit(0);
}

#define rep(i, a, b) for (int i = (int)a; i < (int)b; i++)
#define repi(i, a, b) for (int i = (int)a; i >= (int)b; i--)

void solve() {
  int n;
  cin >> n;
  vvch grid(n, vch(n));

  vpi piecepos;

  rep(i, 0, n) rep(j, 0, n) {
    cin >> grid[i][j];
    if (grid[i][j] == 'o') {
      piecepos.pb({i, j});
    }
  }

  vpi valid_moves;

  vvb attacked(n, vb(n));

  rep(dx, -(n - 1), (n - 1) + 1) {
    rep(dy, -(n - 1), (n - 1) + 1) {
      bool ok = 1;
      for (pi &it : piecepos) {
        int newx = it.fi + dx, newy = it.se + dy;
        if (newx >= 0 && newx <= n - 1 && newy >= 0 && newy <= n - 1) {
          if (grid[newx][newy] == '.') {
            ok = 0;
            break;
          } else {
            // attacked[newx][newy] = 1;
          }
        }
      }
      if (ok) {
        valid_moves.pb({dx, dy});
      }
    }
  }

  for (pi xy : piecepos) {
    for (pi dxy : valid_moves) {
      int newx = dxy.fi + xy.fi, newy = dxy.se + xy.se;
      if (newx >= 0 && newx <= n - 1 && newy >= 0 && newy <= n - 1) {
        attacked[newx][newy] = 1;
      }
    }
  }

  rep(i, 0, n) {
    rep(j, 0, n) {
      if (grid[i][j] == 'x' && !attacked[i][j]) {
        no();
      }
    }
  }

  vvch ans(2 * n - 1, vch(2 * n - 1, '.'));

  for (pi dxy : valid_moves) {
    ans[n - 1 + dxy.fi][n - 1 + dxy.se] = 'x';
  }
  ans[n - 1][n - 1] = 'o';

  cout << "YES\n";
  rep(i, 0, 2 * n - 1) {
    rep(j, 0, 2 * n - 1) cout << ans[i][j];
    cout << "\n";
  }
}

int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);cout.tie(0);
  cout << fixed << setprecision(10);

  int t = 1;

  // cin >> t;

  for (int tc = 1; tc <= t; tc++) {
  	solve();
  }
}


#include <bits/stdc++.h>
#define ll long long
#define FAST ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define f(i, a, b) for(ll i=a; i<b; i++)
#define fr(i,a,b) for(ll i=a;i>=b;i--)
#define pb push_back
#define mp make_pair
#define F first
#define S second
#define LB lower_bound
#define UB upper_bound
#define endl "\n"
#define PI 3.141592653589793
using namespace std;

bool sortbysec(const pair<ll,ll> &a,
              const pair<ll,ll> &b)
{
    return (a.second < b.second);
}

ll maxSubArraySum(ll a[], ll size)
{
    ll max_so_far = INT_MIN, max_ending_here = 0;

    for (ll i = 0; i < size; i++)
    {
        max_ending_here = max_ending_here + a[i];
        if (max_so_far < max_ending_here)
            max_so_far = max_ending_here;

        if (max_ending_here < 0)
            max_ending_here = 0;
    }
    return max_so_far;
}

ll findSubarraySum(ll arr[], ll n, ll sum = 0)
{
    unordered_map<ll, ll> prevSum;
    ll res = 0;
    ll currsum = 0;
    for (ll i = 0; i < n; i++)
    {
        currsum += arr[i];
        if (currsum == sum) res++;
        if (prevSum.find(currsum - sum) != prevSum.end()) res += (prevSum[currsum - sum]);
        prevSum[currsum]++;
    }
    return res;
}
ll gcd(ll a, ll b)
{
    if (a == 0)
        return b;
    return gcd(b % a, a);
}

ll powmp(ll x, ll y, ll p)
{
    ll res = 1;     x = x % p;
    while (y > 0)
    {
        if (y & 1)  res = (res*x) % p;
        y = y>>1;
        x = (x*x) % p;
    }
    return res;
}

int main()
{
    FAST
    int n;cin>>n;
    char grid[n][n];
    f(i,0,n) f(j,0,n) cin>>grid[i][j];
    char ans[2*n-1][2*n-1];
    f(i,0,2*n-1) f(j,0,2*n-1) ans[i][j]='-';
    ans[n-1][n-1]='o';
    vector<pair<int,int>> pcs;
    set<pair<int,int>> hit;
    f(i,0,n)
    {
        f(j,0,n)
        {
            if(grid[i][j]=='o') pcs.pb({i,j});
            else if(grid[i][j]=='x') hit.insert({i,j});
        }
    }
    for(auto p:pcs)
    {
        int x=p.F,y=p.S;
        f(i,0,n)
        {
            f(j,0,n)
            {
                if(grid[i][j]=='x' && hit.find({i,j})!=hit.end())
                {
                    int mx=i-x,my=j-y;
                    int f=0;
                    for(auto t:pcs)
                    {
                        int tx=t.F,ty=t.S;
                        if(tx+mx>=0 && tx+mx<n && ty+my>=0 && ty+my<n && grid[tx+mx][ty+my]=='.')
                        {
                            f=1;
                            break;
                        }
                    }
                    if(!f)
                    {
                        ans[n-1+mx][n-1+my]='x';
                        for(auto t:pcs)
                        {
                            int tx=t.F,ty=t.S;
                            if(hit.find({tx+mx,ty+my})!=hit.end()) hit.erase({tx+mx,ty+my});
                        }
                    }
                }
            }
        }
    }
    if(hit.size()) cout<<"NO\n";
    else
    {
        cout<<"YES\n";
        f(i,0,2*n-1)
        {
            f(j,0,2*n-1)
            {
                if(ans[i][j]!='-') cout<<ans[i][j];
                else cout<<'.';
            }
            cout<<endl;
        }
    }

}


#include <bits/stdc++.h>
#define ll long long
#define FAST ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define f(i, a, b) for(ll i=a; i<b; i++)
#define fr(i,a,b) for(ll i=a;i>=b;i--)
#define pb push_back
#define mp make_pair
#define F first
#define S second
#define LB lower_bound
#define UB upper_bound
#define endl "\n"
#define PI 3.141592653589793
using namespace std;

bool sortbysec(const pair<ll,ll> &a,
              const pair<ll,ll> &b)
{
    return (a.second < b.second);
}

ll maxSubArraySum(ll a[], ll size)
{
    ll max_so_far = INT_MIN, max_ending_here = 0;

    for (ll i = 0; i < size; i++)
    {
        max_ending_here = max_ending_here + a[i];
        if (max_so_far < max_ending_here)
            max_so_far = max_ending_here;

        if (max_ending_here < 0)
            max_ending_here = 0;
    }
    return max_so_far;
}

ll findSubarraySum(ll arr[], ll n, ll sum = 0)
{
    unordered_map<ll, ll> prevSum;
    ll res = 0;
    ll currsum = 0;
    for (ll i = 0; i < n; i++)
    {
        currsum += arr[i];
        if (currsum == sum) res++;
        if (prevSum.find(currsum - sum) != prevSum.end()) res += (prevSum[currsum - sum]);
        prevSum[currsum]++;
    }
    return res;
}
ll gcd(ll a, ll b)
{
    if (a == 0)
        return b;
    return gcd(b % a, a);
}

ll powmp(ll x, ll y, ll p)
{
    ll res = 1;     x = x % p;
    while (y > 0)
    {
        if (y & 1)  res = (res*x) % p;
        y = y>>1;
        x = (x*x) % p;
    }
    return res;
}

int main()
{
    FAST
    int n;cin>>n;
    char grid[n][n];
    f(i,0,n) f(j,0,n) cin>>grid[i][j];
    char ans[2*n-1][2*n-1];
    f(i,0,2*n-1) f(j,0,2*n-1) ans[i][j]='-';
    ans[n-1][n-1]='o';
    vector<pair<int,int>> pcs;
    set<pair<int,int>> hit;
    f(i,0,n)
    {
        f(j,0,n)
        {
            if(grid[i][j]=='o') pcs.pb({i,j});
            else if(grid[i][j]=='x') hit.insert({i,j});
        }
    }
    for(auto p:pcs)
    {
        int x=p.F,y=p.S;
        f(i,0,n)
        {
            f(j,0,n)
            {
                if(grid[i][j]=='x' && hit.find({i,j})!=hit.end())
                {
                    int mx=i-x,my=j-y;
                    int f=0;
                    for(auto t:pcs)
                    {
                        int tx=t.F,ty=t.S;
                        if(tx+mx>=0 && tx+mx<n && ty+my>=0 && ty+my<n && grid[tx+mx][ty+my]=='.')
                        {
                            f=1;
                            break;
                        }
                    }
                    if(!f)
                    {
                        ans[n-1+mx][n-1+my]='x';
                        for(auto t:pcs)
                        {
                            int tx=t.F,ty=t.S;
                            if(hit.find({tx+mx,ty+my})!=hit.end()) hit.erase({tx+mx,ty+my});
                        }
                    }
                }
            }
        }
    }
    if(hit.size()) cout<<"NO";
    else
    {
        cout<<"YES\n";
        f(i,0,2*n-1)
        {
            f(j,0,2*n-1)
            {
                if(ans[i][j]!='-') cout<<ans[i][j]<<" ";
                else cout<<'.'<<" ";
            }
            cout<<endl;
        }
    }
    cout<<endl;

}


#include<bits/stdc++.h>
#define long long long
using namespace std;
const int N=50;
int n,vis[N+2][N+2],mat[N+N+2][N+N+2];
string s[N+2];
bool ck(int dx,int dy)
{
  int cnt=0;
  for(int i=0;i<n;i++)
  {
    for(int j=0;j<n;j++)
    {
      if(s[i][j]=='o')
      {
        int ii=i+dx,jj=j+dy;
        if(ii>=0&&ii<n&&jj>=0&&jj<n)
        {
          if(s[ii][jj]=='.')return false;
          if(s[ii][jj]=='x')cnt++;
        }
      }
    }
  }
  if(cnt)
  {
    for(int i=0;i<n;i++)
    {
      for(int j=0;j<n;j++)
      {
        if(s[i][j]=='o')
        {
          int ii=i+dx,jj=j+dy;
          if(ii>=0&&ii<n&&jj>=0&&jj<n)
          {
            if(s[ii][jj]=='x')vis[ii][jj]=1;
          }
        }
      }
    }
    return true;
  }
  return false;
}
int main()
{
  ios_base::sync_with_stdio(0);cin.tie(0);
  cin>>n;
  for(int i=0;i<n;i++)
    cin>>s[i];
  vector<pair<int,int> >ans;
  for(int i=-50;i<=50;i++)
  {
    for(int j=-50;j<=50;j++)
    {
      if(ck(i,j))ans.push_back({i,j});
    }
  }
  /*for(auto x:ans)
  {
    cout<<x.first<<" "<<x.second<<endl;
  }*/
  for(int i=0;i<n;i++)
  {
    for(int j=0;j<n;j++)
    {
      if(s[i][j]=='x'&&vis[i][j]==0)
        cout<<"NO"<<endl,exit(0);
    }
  }
  cout<<"YES"<<endl;
  for(auto x:ans)
    mat[n+x.first][n+x.second]=1;
  for(int i=1;i<n+n;i++)
  {
    for(int j=1;j<n+n;j++)
    {
      if(i==n&&j==n)cout<<"o";
      else if(mat[i][j])cout<<'x';
      else cout<<".";
    }
    cout<<endl;
  }
  return 0;
}


#include <iostream>
#include <cstdio>
#include <cstring>
#include <algorithm>
#include <vector>
#include <queue>
#include <cmath>
#include <stack>
#include <set>
#include <map>
using namespace std;

const int N = 210;
char s[N][N], ans[N][N];

int main()
{
	int n;
	scanf("%d", &n);
	for (int i = 0; i < n; i++)
		scanf("%s", s[i]);

	for (int i = 0; i < 2 * n - 1; i++)
		for (int j = 0; j < 2 * n - 1; j++)
			ans[i][j] = 'x';

	ans[n - 1][n - 1] = 'o';
	for (int i = 0; i < n; i++)
		for (int j = 0; j < n; j++)
			if (s[i][j] == 'o')
				for (int k = 0; k < n; k++)
					for (int r = 0; r < n; r++)
						if (s[k][r] == '.')
							ans[k - i + n - 1][r - j + n - 1] = '.';

	for (int i = 0; i < n; i++)
		for (int j = 0; j < n; j++) {
			if (s[i][j] != 'x') continue;
			bool flag = false;
			for (int k = 0; k < n; k++)
				for (int r = 0; r < n; r++)
					if (s[k][r] == 'o') {
						if (ans[k - i + n - 1][r - j + n - 1] == 'x') {
							flag = true;

						}
					}
			if (!flag) {
				printf("NO\n");
				return 0;
			}
		}

	printf("YES\n");
	for (int i = 0; i < 2 * n - 1; i++)
		printf("%s\n", ans[i]);
	return 0;
}


#include <iostream>
#include <cstdio>
#include <cstring>
#include <algorithm>
#include <vector>
#include <queue>
#include <cmath>
#include <stack>
#include <set>
#include <map>
using namespace std;

const int N = 210;
char s[N][N], ans[N][N];

int main()
{
	int n;
	scanf("%d", &n);
	for (int i = 0; i < n; i++)
		scanf("%s", s[i]);

	for (int i = 0; i < 2 * n - 1; i++)
		for (int j = 0; j < 2 * n - 1; j++)
			ans[i][j] = 'x';

	ans[n - 1][n - 1] = 'o';
	for (int i = 0; i < n; i++)
		for (int j = 0; j < n; j++)
			if (s[i][j] == 'o')
				for (int k = 0; k < n; k++)
					for (int r = 0; r < n; r++)
						if (s[k][r] == '.')
							ans[k - i + n - 1][r - j + n - 1] = '.';

	for (int i = 0; i < n; i++)
		for (int j = 0; j < n; j++) {
			if (s[i][j] != 'x') continue;
			bool flag = false;
			for (int k = 0; k < n; k++)
				for (int r = 0; r < n; r++)
					if (s[k][r] == 'o') {
						if (ans[i - k + n - 1][j - r + n - 1] == 'x') {
							flag = true;

						}
					}
			if (!flag) {
				printf("NO\n");
				return 0;
			}
		}

	printf("YES\n");
	for (int i = 0; i < 2 * n - 1; i++)
		printf("%s\n", ans[i]);
	return 0;
}


#include <bits/stdc++.h>

using namespace std;

#define mx 55
#define int long long
#define pii pair <int, int>
#define piii pair <int, pii>
#define f first
#define s second
#define mod 1000000007

string star[mx];
vector <pii> v;
vector <pii> nn;
int ara[mx][mx], tst[mx][mx];

int32_t main(){
    //freopen("in.txt", "r", stdin);
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    int n;
    while(cin >> n){
        memset(ara, 0, sizeof ara);
        memset(tst, 0, sizeof tst);
        for(int i=0;i<n;i++){
            cin >> star[i];
        }
        int ans[2*n][2*n];
        memset(ans, 0, sizeof ans);
        bool flag = true;
        for(int i=0;i<n;i++){
            for(int j=0;j<n;j++){
                if(star[i][j]=='o'){
                    for(int l=0;l<n;l++){
                        for(int k=0;k<n;k++){
                            if(star[l][k]=='.'){
                                int a, b, dx, dy;
                                dx  = l - i;
                                dy  = k - j;
                                a = n - 1 + dx;
                                b = n - 1 + dy;
                                if(a>=0&&b>=0&&a<2*n-1&&b<2*n-1) ans[a][b] = 1;
                            }
                        }
                    }
                }
            }
        }
        for(int i=0;i<2*n-1;i++){
            for(int j=0;j<2*n-1;j++){
                if(i==n-1&&j==n-1) continue;
                if(ans[i][j]==0){
                    int dx, dy;
                    dx = i - n + 1;
                    dy = j - n + 1;
                    for(int l=0;l<n;l++){
                        for(int k=0;k<n;k++){
                            if(star[l][k]=='o'){
                                int a = l+dx;
                                int b = k+dy;
                                if(a>=0&&b>=0&&a<n&&b<n) {
                                    if(star[a][b]=='.'){
                                        flag = false;
                                    }
                                    tst[a][b] = 1;
                                }
                            }
                        }
                    }
                }
            }
        }
        for(int i=0;i<n;i++){
            for(int j=0;j<n;j++){
                if(star[i][j]=='x' && tst[i][j]==0) flag = false;
            }
        }
        if(!flag){
            cout << "NO" << endl;
            continue;
        }
        cout << "YES" << endl;
        for(int i=0;i<2*n-1;i++){
            for(int j=0;j<2*n-1;j++){
                if(i==n-1&&j==n-1) cout << 'o';
                else if(ans[i][j]==0) cout << 'x';
                else cout << '.';
            }
            cout << endl;
        }
    }
    return 0;
}


#include<bits/stdc++.h>
#define PI 3.141592653589793238462
using namespace std;
typedef long long ll;
typedef double db;
char c[55][55],a[200][200],b[55][55];
vector<pair<int,int>> p,num,op;
bool check(int n){
    for(int i=1;i<=n;i++){
        for(int j=1;j<=n;j++){
            b[i][j]='.';
        }
    }
    for(auto i:p){
        b[i.first][i.second]='o';
    }
    for(auto i:p){
        for(auto j:op){
            int x=j.first+i.first,y=j.second+i.second;
            if(x>n||x<1||y>n||y<1||b[x][y]=='o') continue;
            b[x][y]='x';
        }
    }

    for(int i=1;i<=n;i++){
        for(int j=1;j<=n;j++){
            if(b[i][j]!=c[i][j]) return false;
        }
    }
    return true;
}
int main(){
    int n;cin>>n;
    for(int i=1;i<=n;i++){
        for(int j=1;j<=n;j++){
            cin>>c[i][j];
            if(c[i][j]=='o') p.push_back({i,j});
        }
    }
    for(int i=1;i<=n;i++){
        for(int j=1;j<=n;j++){
            if(c[i][j]=='x'){
                for(auto k:p){
                    num.push_back({i-k.first,j-k.second});
                }
            }
        }
    }
    for(auto i:num){
        int sum=0;
        for(auto j:p){
            int x=j.first+i.first,y=j.second+i.second;
            if(x>n||x<1||y>n||y<1||c[x][y]!='.') sum++;
        }
        if(sum==p.size()) op.push_back(i);
    }
    for(int i=1;i<=2*n-1;i++){
        for(int j=1;j<=2*n-1;j++){
            a[i][j]='.';
        }
    }
    if(!check(n)) {cout<<"NO"<<endl;return 0;}
    cout<<"YES"<<endl;
    a[n][n]='o';
    for(auto i:op){
        a[n+i.first][n+i.second]='x';
    }
    for(int i=1;i<=2*n-1;i++){
        for(int j=1;j<=2*n-1;j++){
            cout<<a[i][j];
        }cout<<endl;
    }
}


#include<bits/stdc++.h>
#define PI 3.141592653589793238462
using namespace std;
typedef long long ll;
typedef double db;
char c[55][55],a[200][200],b[55][55];
map<pair<int,int>,int> num;
vector<pair<int,int>> p,op;
bool check(int n){
    for(int i=1;i<=n;i++){
        for(int j=1;j<=n;j++){
            b[i][j]='.';
        }
    }
    for(auto i:p){
        b[i.first][i.second]='o';
    }
    for(auto i:p){
        for(auto j:op){
            int x=j.first+i.first,y=j.second+i.second;
            if(x>n||x<1||y>n||y<1||b[x][y]=='o') continue;
            b[x][y]='x';
        }
    }
    for(int i=1;i<=n;i++){
        for(int j=1;j<=n;j++){
            if(b[i][j]!=c[i][j]) return false;
        }
    }
    return true;
}
int main(){
    int n;cin>>n;
    for(int i=1;i<=n;i++){
        for(int j=1;j<=n;j++){
            cin>>c[i][j];
            if(c[i][j]=='o') p.push_back({i,j});
        }
    }
    for(int i=1;i<=n;i++){
        for(int j=1;j<=n;j++){
            if(c[i][j]=='x'){
                for(auto k:p){
                    num[{i-k.first,j-k.second}]++;
                }
            }
        }
    }
    for(auto i:num){
        int sum=0;
        for(auto j:p){
            int x=j.first+i.first.first,y=j.second+i.first.second;
            if(x>n||x<1||y>n||y<1||c[x][y]!='.') sum++;
        }
        if(sum==p.size()) op.push_back(i.first);
    }
    for(int i=1;i<=2*n-1;i++){
        for(int j=1;j<=2*n-1;j++){
            a[i][j]='.';
        }
    }
    if(!check(n)) {cout<<"NO"<<endl;return 0;}
    cout<<"YES"<<endl;
    a[n][n]='o';
    for(auto i:op){
        a[n+i.first][n+i.second]='x';
    }
    for(int i=1;i<=2*n-1;i++){
        for(int j=1;j<=2*n-1;j++){
            cout<<a[i][j];
        }cout<<endl;
    }
}


#include<bits/stdc++.h>
#define PI 3.141592653589793238462
using namespace std;
typedef long long ll;
typedef double db;
char c[55][55],a[200][200],b[55][55];
vector<pair<int,int>> p,num,op;
bool check(int n){
    for(int i=1;i<=n;i++){
        for(int j=1;j<=n;j++){
            b[i][j]='.';
        }
    }
    for(auto i:p){
        b[i.first][i.second]='o';
    }
    for(auto i:p){
        for(auto j:op){
            int x=j.first+i.first,y=j.second+i.second;
            if(x>n||x<1||y>n||y<1) continue;
            b[x][y]='x';
        }
    }

    for(int i=1;i<=n;i++){
        for(int j=1;j<=n;j++){
            if(b[i][j]!=c[i][j]) return false;
        }
    }
    return true;
}
int main(){
    int n;cin>>n;
    for(int i=1;i<=n;i++){
        for(int j=1;j<=n;j++){
            cin>>c[i][j];
            if(c[i][j]=='o') p.push_back({i,j});
        }
    }
    for(int i=1;i<=n;i++){
        for(int j=1;j<=n;j++){
            if(c[i][j]=='x'){
                for(auto k:p){
                    num.push_back({i-k.first,j-k.second});
                }
            }
        }
    }
    for(auto i:num){
        int sum=0;
        for(auto j:p){
            int x=j.first+i.first,y=j.second+i.second;
            if(x>n||x<1||y>n||y<1||c[x][y]=='x') sum++;
        }
        if(sum==p.size()) op.push_back(i);
    }
    for(int i=1;i<=2*n-1;i++){
        for(int j=1;j<=2*n-1;j++){
            a[i][j]='.';
        }
    }
    if(!check(n)) {cout<<"NO"<<endl;return 0;}
    cout<<"YES"<<endl;
    a[n][n]='o';
    for(auto i:op){
        a[n+i.first][n+i.second]='x';
    }
    for(int i=1;i<=2*n-1;i++){
        for(int j=1;j<=2*n-1;j++){
            cout<<a[i][j];
        }cout<<endl;
    }
}


#define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <algorithm>
#include <unordered_set>
#include <vector>
#include <cmath>
#include <string>
#include <set>
#include <map>
#include <cstdio>
#include <functional>
#include <random>
#include <ctime>
#include <cassert>
#include <bitset>
#include <unordered_map>
#include <math.h>

using namespace std;

#define N 100005
#define M 20
#define F 200
mt19937 gen(time(NULL));
#define forn(i, n) for (int i = 0; i < n; i++)
#define fornv(i, n) for (int i = n - 1; i >= 0; i--)
#define pii pair<int, int>
#define forlr(i, l, r) for (int i = l; i <= r; i++)
#define forlrv(i, l, r) for (int i = r; i >= l; i--)
#define read(x) scanf("%d", &x)
#define print(x) printf("%d ", x)
#define printl(x) printf("%d\n", x)
#define debug(...) fprintf(stderr, __VA_ARGS__), fflush(stderr)
#define mp make_pair
typedef long long ll;
typedef unsigned long long ull;
const long double eps = 1e-9;
const int inf = 1e9;
const int mod = 1e9 + 7;
const ll infinity = 2 * 1e18;
#define p p2
#define endl '\n'

int w[55][55];
int tmp[55][55];
int n;
vector<pii> figs;

bool ins(int x, int y)
{
	return x >= 0 && x < n && y >= 0 && y < n;
}

int dx[4] = { 1, -1, 1, -1 };
int dy[4] = { 1, 1, -1, -1 };

bool check(int x, int y)
{
	forn(i, n)
		forn(j, n)
			tmp[i][j] = 0;

	for (auto v : figs)
		forn(i, 4)
	{
		int xp = v.first + dx[i] * x;
		int yp = v.second + dy[i] * y;
		if (ins(xp, yp))
			tmp[xp][yp]++;
	}

	forn(i, n)
		forn(j, n)
		if (tmp[i][j] && !w[i][j]) return false;

	return true;
}

char fi[105][105];

int main()
{
	ios_base::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);

	cin >> n;

	forn(i, n)
		forn(j, n)
	{
		char c;
		cin >> c;

		if (c == 'o')
			figs.push_back(mp(i, j));
		if (c == 'o')
			w[i][j] = 2;
		if (c == 'x')
			w[i][j] = 1;
	}

	vector<pii> moves;
	for (int i = 0; i < n; i++)
		for (int j = 0; j <  n; j++)
			if (j + i)
				if (check(i, j))
					moves.push_back(mp(i, j));

	forn(i, n)
		forn(j, n)
		tmp[i][j] = 0;

	for (auto v : moves)
		for (auto k : figs)
			forn(i, 4)
		{
			int xp = k.first + dx[i] * v.first;
			int yp = k.second + dy[i] * v.second;
			if (ins(xp, yp))
				tmp[xp][yp]++;
		}

	forn(i, n)
		forn(j, n)
		if (!w[i][j] && tmp[i][j] || !tmp[i][j] && w[i][j] == 1)
		{
			cout << "NO";
			return 0;
		}

	cout << "YES" << endl;
	int cx = n - 1, cy = n - 1;
	forn(i, 2 * n - 1)
		forn(j, 2 * n - 1)
		fi[i][j] = '.';
	fi[cx][cy] = 'o';
	for (auto v : moves)
		forn(i, 4)
		fi[cx - dx[i] * v.first][cy - dy[i] * v.second] = 'x';

	forn(i, 2 * n - 1)
	{
		forn(j, 2 * n - 1)
			cout << fi[i][j];
		cout << endl;
	}
}


#define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <algorithm>
#include <unordered_set>
#include <vector>
#include <cmath>
#include <string>
#include <set>
#include <map>
#include <cstdio>
#include <functional>
#include <random>
#include <ctime>
#include <cassert>
#include <bitset>
#include <unordered_map>
#include <math.h>

using namespace std;

#define N 100005
#define M 20
#define F 200
mt19937 gen(time(NULL));
#define forn(i, n) for (int i = 0; i < n; i++)
#define fornv(i, n) for (int i = n - 1; i >= 0; i--)
#define pii pair<int, int>
#define forlr(i, l, r) for (int i = l; i <= r; i++)
#define forlrv(i, l, r) for (int i = r; i >= l; i--)
#define read(x) scanf("%d", &x)
#define print(x) printf("%d ", x)
#define printl(x) printf("%d\n", x)
#define debug(...) fprintf(stderr, __VA_ARGS__), fflush(stderr)
#define mp make_pair
typedef long long ll;
typedef unsigned long long ull;
const long double eps = 1e-9;
const int inf = 1e9;
const int mod = 1e9 + 7;
const ll infinity = 2 * 1e18;
#define p p2
#define endl '\n'

int w[55][55];
int tmp[55][55];
int n;
vector<pii> figs;

bool ins(int x, int y)
{
	return x >= 0 && x < n && y >= 0 && y < n;
}

bool check(int x, int y)
{
	forn(i, n)
		forn(j, n)
			tmp[i][j] = 0;

	for (auto v : figs)
		forn(i, 4)
	{
		int xp = v.first + x;
		int yp = v.second + y;
		if (ins(xp, yp))
			tmp[xp][yp]++;
	}

	forn(i, n)
		forn(j, n)
		if (tmp[i][j] && !w[i][j]) return false;

	return true;
}

char fi[105][105];

int main()
{
	ios_base::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);

	cin >> n;

	forn(i, n)
		forn(j, n)
	{
		char c;
		cin >> c;

		if (c == 'o')
			figs.push_back(mp(i, j));
		if (c == 'o')
			w[i][j] = 2;
		if (c == 'x')
			w[i][j] = 1;
	}

	vector<pii> moves;
	for (int i = -n + 1; i < n; i++)
		for (int j = -n + 1; j <  n; j++)
			if (j != 0 || i != 0)
				if (check(i, j))
					moves.push_back(mp(i, j));

	forn(i, n)
		forn(j, n)
		tmp[i][j] = 0;

	for (auto v : moves)
		for (auto k : figs)
		{
			int xp = k.first + v.first;
			int yp = k.second + v.second;
			if (ins(xp, yp))
				tmp[xp][yp]++;
		}

	forn(i, n)
		forn(j, n)
		if (!w[i][j] && tmp[i][j] || !tmp[i][j] && w[i][j] == 1)
		{
			cout << "NO";
			return 0;
		}

	cout << "YES" << endl;
	int cx = n - 1, cy = n - 1;
	forn(i, 2 * n - 1)
		forn(j, 2 * n - 1)
		fi[i][j] = '.';
	fi[cx][cy] = 'o';
	for (auto v : moves)
		fi[cx + v.first][cy + v.second] = 'x';

	forn(i, 2 * n - 1)
	{
		forn(j, 2 * n - 1)
			cout << fi[i][j];
		cout << endl;
	}
}


#define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <algorithm>
#include <unordered_set>
#include <vector>
#include <cmath>
#include <string>
#include <set>
#include <map>
#include <cstdio>
#include <functional>
#include <random>
#include <ctime>
#include <cassert>
#include <bitset>
#include <unordered_map>
#include <math.h>

using namespace std;

#define N 100005
#define M 20
#define F 200
mt19937 gen(time(NULL));
#define forn(i, n) for (int i = 0; i < n; i++)
#define fornv(i, n) for (int i = n - 1; i >= 0; i--)
#define pii pair<int, int>
#define forlr(i, l, r) for (int i = l; i <= r; i++)
#define forlrv(i, l, r) for (int i = r; i >= l; i--)
#define read(x) scanf("%d", &x)
#define print(x) printf("%d ", x)
#define printl(x) printf("%d\n", x)
#define debug(...) fprintf(stderr, __VA_ARGS__), fflush(stderr)
#define mp make_pair
typedef long long ll;
typedef unsigned long long ull;
const long double eps = 1e-9;
const int inf = 1e9;
const int mod = 1e9 + 7;
const ll infinity = 2 * 1e18;
#define p p2
#define endl '\n'

int w[55][55];
int tmp[55][55];
int n;
vector<pii> figs;

bool ins(int x, int y)
{
	return x >= 0 && x < n && y >= 0 && y < n;
}

int dx[4] = { 1, -1, 1, -1 };
int dy[4] = { 1, 1, -1, -1 };

bool check(int x, int y)
{
	forn(i, n)
		forn(j, n)
			tmp[i][j] = 0;

	for (auto v : figs)
		forn(i, 4)
	{
		int xp = v.first + dx[i] * x;
		int yp = v.second + dy[i] * y;
		if (ins(xp, yp))
			tmp[xp][yp]++;
	}

	forn(i, n)
		forn(j, n)
		if (tmp[i][j] && !w[i][j]) return false;

	return true;
}

char fi[105][105];

int main()
{
	ios_base::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);

	cin >> n;

	forn(i, n)
		forn(j, n)
	{
		char c;
		cin >> c;

		if (c == 'o')
			figs.push_back(mp(i, j));
		if (c == 'o')
			w[i][j] = 2;
		if (c == 'x')
			w[i][j] = 1;
	}

	vector<pii> moves;
	for (int i = 0; i < n; i++)
		for (int j = 0; j <  n; j++)
			if (j + i)
				if (check(i, j))
					moves.push_back(mp(i, j));

	forn(i, n)
		forn(j, n)
		tmp[i][j] = 0;

	for (auto v : moves)
		for (auto k : figs)
			forn(i, 4)
		{
			int xp = k.first + dx[i] * v.first;
			int yp = k.second + dy[i] * v.second;
			if (ins(xp, yp))
				tmp[xp][yp]++;
		}

	forn(i, n)
		forn(j, n)
		if (!w[i][j] && tmp[i][j])
		{
			cout << "NO";
			return 0;
		}

	cout << "YES" << endl;
	int cx = n - 1, cy = n - 1;
	forn(i, 2 * n - 1)
		forn(j, 2 * n - 1)
		fi[i][j] = '.';
	fi[cx][cy] = 'o';
	for (auto v : moves)
		forn(i, 4)
		fi[cx - dx[i] * v.first][cy - dy[i] * v.second] = 'x';

	forn(i, 2 * n - 1)
	{
		forn(j, 2 * n - 1)
			cout << fi[i][j];
		cout << endl;
	}
}


#include<bits/stdc++.h>
#define pb push_back
#define mp make_pair
#define fastread ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
#define f(i, x, y) for(int i = x; i < y; i++)
#define all(X) X.begin(), X.end()
#define int long long
#define key pair<int, int>
#define ff first
#define ss second
const  int mod = 1e9 + 7;
const int inf = 1e18;
using namespace std;

char mat[100][100];
bool vis[100][100];
char res[150][150];
bool m[4][50][50];
vector<key> p[10];
int n;

main()
{
    memset(m, true, sizeof(m));
    memset(vis, false, sizeof(vis));
    cin>>n;
    f(i, 1, n+1)
        f(j, 1, n+1)
            cin>>mat[i][j];

    f(i, 1, n+1)
    {
        f(j,1, n+1)
        {
            if(mat[i][j] != 'o')
                continue;
            f(k, 0, 50)
            {
                f(l, 0, 50)
                {
                    f(p, 0, 4)
                    {
                        if(m[p][k][l] == 0)
                            continue;
                        int x, y;
                        if(p == 0)
                            x = k, y = l;
                        else if(p == 1)
                            x = -k, y = l;
                        else if(p == 2)
                            x = k, y  = -l;
                        else
                            x = -k, y = -l;
                        if(i+x > 0 && i+x <= n && j+y > 0 && j+y <= n && mat[i+x][j+y] == '.')
                            m[p][k][l] = false;
                    }
                }
            }
        }
    }
    f(i, 1, n+1)
    {
        f(j,1, n+1)
        {
            if(mat[i][j] != 'o')
                continue;
            f(k, 0, 50)
            {
                f(l, 0, 50)
                {
                    f(p, 0, 4)
                    {
                        if(m[p][k][l] == 0)
                            continue;
                        int x, y;
                        if(p == 0)
                            x = k, y = l;
                        else if(p == 1)
                            x = -k, y = l;
                        else if(p == 2)
                            x = k, y  = -l;
                        else
                            x = -k, y = -l;
                        if(i+x > 0 && i+x <= n && j+y > 0 && j+y <= n && mat[i+x][j+y] == 'x')
                            vis[i+x][j+y] = true;
                    }
                }
            }
        }
    }
/*    f(i, 0, n+1)
    {
        f(j, 0, n+1)
            cout<<vis[i][j];
        cout<<"\n";
    }
*/    //cout<<<"a";
    f(i, 1, n+1)
        f(j, 1, n+1)
            if((mat[i][j] == 'x' && vis[i][j] == false))
            {
                cout<<"NO"; return 0;
            }

    memset(res, '.', sizeof(res));
    int i = n, j = n;
    res[i][j] = 'o';
    f(k, 0, 50)
        f(l, 0, 50)
            f(p, 0, 4)
            {
                if(m[p][k][l] == 0)
                        continue;
                int x, y;
                if(p == 0)
                    x = k, y = l;
                else if(p == 1)
                    x = -k, y = l;
                else if(p == 2)
                    x = k, y  = -l;
                else
                    x = -k, y = -l;
                if(i+x > 0 && i+x < 2*n && j+y > 0 && j+y < 2*n )
                    res[i+x][j+y] = 'x';

            }
    res[n][n] = 'o';
    cout<<"YES\n";
    f(k, 1, 2*n)
    {
        f(l, 1, 2*n)
            cout<<res[k][l];
        cout<<"\n";
    }
}


#include<bits/stdc++.h>
#define pb push_back
#define mp make_pair
#define fastread ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
#define f(i, x, y) for(int i = x; i < y; i++)
#define all(X) X.begin(), X.end()
#define int long long
#define key pair<int, int>
#define ff first
#define ss second
const  int mod = 1e9 + 7;
const int inf = 1e18;
using namespace std;

char mat[100][100];
bool vis[100][100];
char res[150][150];
bool m[4][50][50];
vector<key> p[10];
int n;

main()
{
    memset(m, true, sizeof(m));
    memset(vis, false, sizeof(vis));
    cin>>n;
    f(i, 1, n+1)
        f(j, 1, n+1)
            cin>>mat[i][j];

    f(i, 1, n+1)
    {
        f(j,1, n+1)
        {
            if(mat[i][j] != 'o')
                continue;
            f(k, 0, 50)
            {
                f(l, 0, 50)
                {
                    f(p, 0, 4)
                    {
                        if(m[p][k][l] == 0)
                            continue;
                        int x, y;
                        if(p == 0)
                            x = k, y = l;
                        else if(p == 1)
                            x = -k, y = l;
                        else if(p == 2)
                            x = k, y  = -l;
                        else
                            x = -k, y = -l;
                        if(i+x > 0 && i+x <= n && j+y > 0 && j+y <= n && mat[i+x][j+y] == '.')
                            m[p][k][l] = false;
                    }
                }
            }
        }
    }
    f(i, 1, n+1)
    {
        f(j,1, n+1)
        {
            if(mat[i][j] != 'o')
                continue;
            f(k, 0, 50)
            {
                f(l, 0, 50)
                {
                    f(p, 0, 4)
                    {
                        if(m[p][k][l] == 0)
                            continue;
                        int x, y;
                        if(p == 0)
                            x = k, y = l;
                        else if(p == 1)
                            x = -k, y = l;
                        else if(p == 2)
                            x = k, y  = -l;
                        else
                            x = -k, y = -l;
                        if(i+x > 0 && i+x <= n && j+y > 0 && j+y <= n && mat[i+x][j+y] == 'x')
                            vis[i+x][j+y] = true;
                    }
                }
            }
        }
    }
/*    f(i, 0, n+1)
    {
        f(j, 0, n+1)
            cout<<vis[i][j];
        cout<<"\n";
    }
*/    //cout<<<"a";
    f(i, 1, n+1)
        f(j, 1, n+1)
            if((mat[i][j] == 'x' && vis[i][j] == false))
            {
                cout<<"NO"; return 0;
            }

    memset(res, '.', sizeof(res));
    int i = n, j = n;
    res[i][j] = 'o';
    f(k, 0, 50)
        f(l, 0, 50)
            f(p, 0, 4)
            {
                if(m[p][k][l] == 0)
                        continue;
                int x, y;
                if(p == 0)
                    x = k, y = l;
                else if(p == 1)
                    x = -k, y = l;
                else if(p == 2)
                    x = k, y  = -l;
                else
                    x = -k, y = -l;
                if(i+x > 0 && i+x < 2*n && j+y > 0 && j+y < 2*n )
                    res[i+x][j+y] = 'x';

            }
    res[n][n] = 'o';
    f(k, 1, 2*n)
    {
        f(l, 1, 2*n)
            cout<<res[k][l];
        cout<<"\n";
    }
}


#include<iostream>
#include<vector>
#include<algorithm>
using namespace std;
int main ()
{
    int n;
    cin >> n;
    char v[n+1][n+1];
    vector<pair<int, int> > poz, sol;
    for(int i = 0; i < n; i ++) {
        for(int j = 0; j < n; j ++) {
            cin >> v[i][j];
            if(v[i][j] == 'o') {
                poz.push_back({i, j});
            }
        }
    }
    // gasire solutii
    int c[4] = {-1, -1, 1, 1}, l[4] = {-1, 1, -1, 1}, lin, col;
    for (int i = 0; i < n; i ++) {
        for (int j = 0; j < n; j ++) {
            for (int k = 0; k < 4; k ++) {
                bool pp = 1;
                for (int h = 0; h < poz.size(); h ++) {
                    lin = i * l[k] + poz[h].first;
                    col = j * c[k] + poz[h].second;
                    if (lin < n && lin >= 0 && col < n && col >= 0 && v[lin][col] == '.') {
                        pp = 0;
                        break;
                    }
                }
                if (pp == 1) {
                    sol.push_back({i * l[k], j * c[k]});
                }
            }
        }
    }
    // verificare daca acopera toate punctele
    for(int i = 0; i < sol.size(); i ++) {
        for (int j = 0; j < poz.size(); j ++) {
            lin = poz[j].first + sol[i].first;
            col = poz[j].second + sol[i].second;
            if (lin < n && lin >= 0 && col < n && col >= 0 && v[lin][col] == 'x') {
                v[lin][col] = '.';
            }
        }
    }

    for (int i = 0; i < n; i ++) {
        for (int j = 0; j < n; j ++) {
            if (v[i][j] == 'x') {
                cout << "NO";
                return 0;
            }
        }
    }
    // crearea matricei in cazul in care exista solutie
    int m = 2*n - 1;
    n --;
    char a[m][m];
    for (int i = 0; i < m; i ++) {
        for (int j = 0; j < m; j ++) {
            a[i][j] = '.';
        }
    }

    for (int i = 0; i < sol.size(); i ++) {
        a[n + sol[i].first][n + sol[i].second] = 'x';
    }
    a[n][n] = 'o';

    cout << "YES\n";
    for (int i = 0; i < m; i ++) {
        for (int j = 0; j < m; j ++) {
            cout << a[i][j];
        }
        cout << '\n';
    }

    return 0;
}


#include<iostream>
#include<vector>
#include<algorithm>
using namespace std;
int main ()
{
    int n;
    cin >> n;
    char v[n+1][n+1];
    vector<pair<int, int> > poz, sol;
    for(int i = 0; i < n; i ++) {
        for(int j = 0; j < n; j ++) {
            cin >> v[i][j];
            if(v[i][j] == 'o') {
                poz.push_back({i, j});
            }
        }
    }

    int c[4] = {-1, -1, 1, 1}, l[4] = {-1, 1, -1, 1}, lin, col;
    for (int i = 0; i < n; i ++) {
        for (int j = 0; j < n; j ++) {
            for (int k = 0; k < 4; k ++) {
                bool pp = 1;
                for (int h = 0; h < poz.size(); h ++) {
                    lin = i * l[k] + poz[h].first;
                    col = j * c[k] + poz[h].second;
                    if (lin < n && lin >= 0 && col < n && col >= 0 && v[lin][col] == '.') {
                        pp = 0;
                        break;
                    }
                }
                if (pp == 1) {
                    sol.push_back({i * l[k], j * c[k]});
                }
            }
        }
    }

    int m = 2*n - 1;
    n --;
    char a[m][m];
    for (int i = 0; i < m; i ++) {
        for (int j = 0; j < m; j ++) {
            a[i][j] = '.';
        }
    }

    for (int i = 0; i < sol.size(); i ++) {
        a[n + sol[i].first][n + sol[i].second] = 'x';
    }
    a[n][n] = 'o';

    cout << "YES\n";
    for (int i = 0; i < m; i ++) {
        for (int j = 0; j < m; j ++) {
            cout << a[i][j];
        }
        cout << '\n';
    }

    return 0;
}


#include <bits/stdc++.h>
using namespace std;
int n;
char arr[100][100];
char arr2[100][100];
char sketch[200][200];
bool isValid(int a, int b){
	if(a < 0 || a >= n || b < 0 || b >= n)
		return false;
	return true;
}
void accomodate(int a, int b){
	for (int i = 0; i < n; ++i)
	{
		for(int j = 0; j < n; j++){
			int p = i - a;
			int q = j - b;
			p += n - 1;
			q += n - 1;
			if(arr[i][j] == 'x' && sketch[p][q] == '_'){
				sketch[p][q] = 'x';
			}
			if(arr[i][j] == '.')
				sketch[p][q] = '.';
		}
	}
}
void printSketch(){
	for (int i = 0; i < 2*n - 1; ++i){
		for(int j = 0; j< 2*n - 1; j++)
			cout<<sketch[i][j];
		cout<<endl;
	}
	// cout<<endl;
}
void repaintSketch(){
	for (int i = 0; i < 2*n - 1; ++i){
		for(int j = 0; j< 2*n - 1; j++)
			if(sketch[i][j] == '_')
				sketch[i][j] = '.';
	}
}
void attack(int a, int b){
	for (int i = 0; i < 2*n - 1; ++i)
	{
		for(int j = 0; j < 2*n - 1; j++){
			if(arr2[i][j] == 'o')
				continue;
			int p = i - (n-1);
			int q = j - (n-1);
			p += a;
			q += b;
			if(!isValid(p,q))
				continue;
			if(sketch[i][j] == 'x')
				arr2[p][q] = 'x';
		}
	}
}
int main(int argc, char const *argv[])
{
	cin>>n;
	for (int i = 0; i < n; ++i)
		for(int j = 0; j< n; j++)
			cin>>arr[i][j];
	for (int i = 0; i < 2*n - 1; ++i)
		for(int j = 0; j< 2*n - 1; j++)
			sketch[i][j] = '_';

	sketch[n-1][n-1] = 'o';

	for (int i = 0; i < n; ++i)
		for(int j = 0; j< n; j++)
			if(arr[i][j] == 'o')
				accomodate(i,j);

	repaintSketch();

	for (int i = 0; i < n; ++i)
		for(int j = 0; j< n; j++)
			arr2[i][j] = '.';

	for (int i = 0; i < n; ++i)
		for(int j = 0; j< n; j++)
			if(arr[i][j] == 'o'){
				arr2[i][j] = 'o';
				attack(i,j);
			}
	bool ans = true;
	for (int i = 0; i < n; ++i){
		for(int j = 0; j< n; j++){
			// cout<<arr2[i][j]<<" ";
			if(arr[i][j] != arr2[i][j])
				ans = false;
		}
		// cout<<endl;
	}
	if(ans){
		cout<<"YES\n";
		printSketch();
	}
	else{
		cout<<"NO\n";
		return 0;
	}

	return 0;
}


#include <bits/stdc++.h>
using namespace std;
int n;
char arr[100][100];
char arr2[100][100];
char sketch[200][200];
bool isValid(int a, int b){
	if(a < 0 || a >= n || b < 0 || b >= n)
		return false;
	return true;
}
void accomodate(int a, int b){
	for (int i = 0; i < n; ++i)
	{
		for(int j = 0; j < n; j++){
			if( a == i && b == j)
				continue;
			int p = i - a;
			int q = j - b;
			p += n - 1;
			q += n - 1;
			if(arr[i][j] == 'x' && sketch[p][q] == '_'){
				sketch[p][q] = 'x';
			}
			if(arr[i][j] == '.')
				sketch[p][q] = '.';
		}
	}
}
void printSketch(){
	for (int i = 0; i < 2*n - 1; ++i){
		for(int j = 0; j< 2*n - 1; j++)
			cout<<sketch[i][j];
		cout<<endl;
	}
	// cout<<endl;
}
void repaintSketch(){
	for (int i = 0; i < 2*n - 1; ++i){
		for(int j = 0; j< 2*n - 1; j++)
			if(sketch[i][j] == '_')
				sketch[i][j] = '.';
	}
}
void attack(int a, int b){
	for (int i = 0; i < 2*n - 1; ++i)
	{
		for(int j = 0; j < 2*n - 1; j++){
			if(arr2[i][j] == 'o')
				continue;
			int p = i - (n-1);
			int q = j - (n-1);
			p += a;
			q += b;
			if(!isValid(p,q))
				continue;
			if(sketch[i][j] == 'x')
				arr2[p][q] = 'x';
		}
	}
}
int main(int argc, char const *argv[])
{
	cin>>n;
	for (int i = 0; i < n; ++i)
		for(int j = 0; j< n; j++)
			cin>>arr[i][j];
	for (int i = 0; i < 2*n - 1; ++i)
		for(int j = 0; j< 2*n - 1; j++)
			sketch[i][j] = '_';

	sketch[n-1][n-1] = 'o';

	for (int i = 0; i < n; ++i)
		for(int j = 0; j< n; j++)
			if(arr[i][j] == 'o')
				accomodate(i,j);

	repaintSketch();

	for (int i = 0; i < n; ++i)
		for(int j = 0; j< n; j++)
			arr2[i][j] = '.';

	for (int i = 0; i < n; ++i)
		for(int j = 0; j< n; j++)
			if(arr[i][j] == 'o'){
				arr2[i][j] = 'o';
				attack(i,j);
			}
	sketch[n-1][n-1] = 'o';

	bool ans = true;
	for (int i = 0; i < n; ++i){
		for(int j = 0; j< n; j++){
			// cout<<arr2[i][j]<<" ";
			if(arr[i][j] != arr2[i][j] && arr[i][j] != 'o')
				ans = false;
		}
		// cout<<endl;
	}
	// printSketch();
	if(ans){
		cout<<"YES\n";
		printSketch();
	}
	else{
		cout<<"NO\n";
		return 0;
	}

	return 0;
}


#include<bits/stdc++.h>
using namespace std;

main()
{
	int n;
	cin>>n;

	vector<string> v(n),ans;
	string tmp="";

	for(int i=0;i<2*n-1;i++)
	{
		tmp+=".";
	}

	for(int i=0;i<2*n-1;i++)
	{
		ans.push_back(tmp);
	}

	for(int i=0;i<n;i++)
	cin>>v[i];

	set<pair<int,int>> s;

		for(int i=-n;i<=n;i++)
		{
			for(int j=-n;j<=n;j++)
			{
				int flag=1,cnt=0;
				for(int k=0;k<n;k++)
				{
					for(int l=0;l<n;l++)
					{
						if(v[k][l]=='o')
						{
							if((k+i<n && k+i>=0) && (l+j<n && l+j>=0))
							{
								if(v[k+i][j+l]=='.')
								{
									flag=0;
									break;
								}
								else if(v[k+i][j+l]=='x')
								cnt++;
							}
						}
					}
				}

				if(flag && cnt)
				s.insert({i,j});
			}
		}

	int flag=1;

	for(auto it:s)
	{
		int i=it.first,j=it.second;

		for(int k=0;k<n;k++)
		{
			for(int l=0;l<n;l++)
			{
				if(v[k][l]=='o')
				{
					if((k+i<n && k+i>=0) && (l+j<n && l+j>=0))
					{
						if(v[k+i][j+l]=='x')
						{
							v[k+i][j+l]='.';
						}
					}
				}
			}
		}
	}

	for(int i=0;i<n;i++)
	{
		for(int j=0;j<n;j++)
		{
			if(v[i][j]=='x')
			{
				flag=0;
				break;
			}
		}
	}

	if(!flag)
	cout<<"NO";
	else
	{
		cout<<"YES"<<endl;

		ans[n-1][n-1]='o';

		for(auto it:s)
		{
			int i=it.first,j=it.second;
			cout<<i<<" "<<j<<endl;
			if((n-1+i<2*n-1 && n-1+i>=0) && (n-1+j<2*n-1 && n-1+j>=0))
			{
				//if()
				{
					ans[n-1+i][n-1+j]='x';

				}
			}
		}

		for(int i=0;i<2*n-1;i++)
		cout<<ans[i]<<endl;
	}
}


#include<bits/stdc++.h>
using namespace std;

main()
{
	int n;
	cin>>n;

	vector<string> v(n),ans;
	string tmp="";

	for(int i=0;i<2*n-1;i++)
	{
		tmp+=".";
	}

	for(int i=0;i<2*n-1;i++)
	{
		ans.push_back(tmp);
	}

	for(int i=0;i<n;i++)
	cin>>v[i];

	set<pair<int,int>> s;

		for(int i=-n;i<=n;i++)
		{
			for(int j=-n;j<=n;j++)
			{
				int flag=1,cnt=0;
				for(int k=0;k<n;k++)
				{
					for(int l=0;l<n;l++)
					{
						if(v[k][l]=='o')
						{
							if((k+i<n && k+i>=0) && (l+j<n && l+j>=0))
							{
								if(v[k+i][j+l]=='.')
								{
									flag=0;
									break;
								}
								else if(v[k+i][j+l]=='x')
								cnt++;
							}
						}
					}
				}

				if(flag && cnt)
				s.insert({i,j});
			}
		}

	int flag=1;

	for(auto it:s)
	{
		int i=it.first,j=it.second;

		for(int k=0;k<n;k++)
		{
			for(int l=0;l<n;l++)
			{
				if(v[k][l]=='o')
				{
					if((k+i<n && k+i>=0) && (l+j<n && l+j>=0))
					{
						if(v[k+i][j+l]=='x')
						{
							v[k+i][j+l]='.';
						}
					}
				}
			}
		}
	}

	for(int i=0;i<n;i++)
	{
		for(int j=0;j<n;j++)
		{
			if(v[i][j]=='x')
			{
				flag=0;
				break;
			}
		}
	}

	if(!flag)
	cout<<"NO";
	else
	{
		cout<<"YES"<<endl;

		ans[n-1][n-1]='o';

		for(auto it:s)
		{
			int i=it.first,j=it.second;
			//cout<<i<<" "<<j<<endl;
			if((n-1+i<2*n-1 && n-1+i>=0) && (n-1+j<2*n-1 && n-1+j>=0))
			{
				//if()
				{
					ans[n-1+i][n-1+j]='x';

				}
			}
		}

		for(int i=0;i<2*n-1;i++)
		cout<<ans[i]<<endl;
	}
}


#include <bits/stdc++.h>
using namespace std;

int n, cnt, cntx, ck[55][55];
char s[55][55], ans[400][400];
bool flag;

map< pair<int, int>, int > mp;
vector< pair<int, int> > v;

bool go(int dx, int dy)
{
	for (int i = 0; i < v.size(); i++)
	{
		int x = v[i].first + dx;
		int y = v[i].second + dy;
		if (x < 0 || x >= n || y < 0 || y >= n)continue;
		if (s[x][y] == '.')return false;
	}

	return true;
}

int main()
{
	flag = true; cnt = cntx = 0;
	scanf("%d", &n);

	for (int i = 0; i < n; i++)
	{
		for (int j = 0; j < n; j++)
		{
			scanf(" %c", &s[i][j]);
			if (s[i][j] == 'o')v.push_back({i, j});
			else if (s[i][j] == 'x')cntx++;
		}
	}

	for (int i = -n; i <= n; i++)
	{
		for (int j = -n; j <= n; j++)
		{
			if (go(i, j)) {
				mp[ {i, j}] = 1;

			}
		}
	}

	for (int k = 0; k < v.size(); k++)
	{
		for (auto it = mp.begin(); it != mp.end(); it++)
		{
			int x = v[k].first + (it->first).first;
			int y = v[k].second + (it->first).second;
			if (x < 0 || x >= n || y < 0 || y >= n) continue;

			if (!ck[x][y] && s[x][y] == 'x')
			{

				ck[x][y] = 1;
				cnt++;
			}
		}
	}

	if (cntx == cnt)
	{
		printf("YES\n");
		for (int i = 1; i <= (2 * n - 1); i++)
		{
			for (int j = 1; j <= (2 * n - 1); j++)
			{
				if (i == n && j == n)printf("o");
				else if (mp[ {i - n, j - n}])printf("x");
				else printf(".");
			}
			printf("\n");
		}
	}
	else
	{
		printf("NO\n");
	}

}


#include <bits/stdc++.h>
using namespace std;

int n, cnt, cntx, ck[55][55];
char s[55][55], ans[400][400];
bool flag;

map< pair<int, int>, int > mp;
vector< pair<int, int> > v;

bool go(int dx, int dy)
{
	for (int i = 0; i < v.size(); i++)
	{
		int x = v[i].first + dx;
		int y = v[i].second + dy;
		if (x < 0 || x >= n || y < 0 || y >= n)continue;
		if (s[x][y] == '.')return false;
	}

	return true;
}

int main()
{
	flag = true; cnt = cntx = 0;
	scanf("%d", &n);

	for (int i = 0; i < n; i++)
	{
		for (int j = 0; j < n; j++)
		{
			scanf(" %c", &s[i][j]);
			if (s[i][j] == 'o')v.push_back({i, j});
			else if (s[i][j] == 'x')cntx++;
		}
	}

	for (int i = -n; i <= n; i++)
	{
		for (int j = -n; j <= n; j++)
		{
			if (go(i, j)) {
				mp[ {i, j}] = 1;
			}
		}
	}

	for (int k = 0; k < v.size(); k++)
	{
		for (auto it = mp.begin(); it != mp.end(); it++)
		{
			int x = v[k].first + (it->first).first;
			int y = v[k].second + (it->first).second;
			if (x < 0 || x >= n || y < 0 || y >= n) continue;

			if (!ck[x][y] && s[x][y] == 'x')
			{

				ck[x][y] = 1;
				cnt++;
			}
		}
	}

	if (cntx == cnt)
	{
		printf("YES\n");
		for (int i = 1; i <= (2 * n - 1); i++)
		{
			for (int j = 1; j <= (2 * n - 1); j++)
			{
				if (i == n && j == n)printf("o");
				else if (mp[ {n - i, n - j}])printf("x");
				else printf(".");
			}
			printf("\n");
		}
	}
	else
	{
		printf("NO\n");
	}

}


#include <bits/stdc++.h>
using namespace std;
int const N = 111;
int n;
bool ans[N][N] , vis[N][N];
string s[N];
int main(){
	ios::sync_with_stdio(false),cin.tie(0),cout.tie(0);
	cin >> n;
	for(int i = 0 ; i < n ; i++)
		cin >> s[i];
	for(int i = -n+1 ; i <= n-1 ; i++){
		for(int j = -n+1 ; j <= n-1 ; j++){
			bool fl = 1;
			for(int x = 0 ; x < n && fl ; x++){
				for(int y = 0 ; y < n && fl ; y++){
					if(s[x][y] != 'o') continue;
					int nx = x + i , ny = y + j;
					fl = (min(nx,ny)<0 || max(nx,ny)>=n || s[nx][ny] != '.');
				}
			}
			if(!fl) continue;
			ans[i+n][j+n] = 1;
			for(int x = 0 ; x < n ; x++){
				for(int y = 0 ; y < n ; y++){
					if(s[x][y] != 'o') continue;
					int nx = x + i , ny = y + j;
					if(min(nx,ny) >= 0 && max(nx,ny) < n)
						vis[nx][ny] = 1;
				}
			}
		}
	}
	for(int i = 0 ; i < n ; i++)
		for(int j = 0 ; j < n ; j++)
			if(s[i][j] == 'x' && !vis[i][j])
				return cout << "NO\n" , 0;
	cout << "YES\n";
	for(int i = 1 ; i < 2*n ; i++){
		for(int j = 1 ; j < 2*n ; j++)
			if(i == n && j == n)
				cout << 'o';
			else
				cout << (ans[i][j] ? 'x' : '.');
		cout << '\n';
	}
}


#include <bits/stdc++.h>
using namespace std;
int const N = 111;
int n;
bool ans[N][N] , vis[N][N];
string s[N];
int main(){
	ios::sync_with_stdio(false),cin.tie(0),cout.tie(0);
	cin >> n;
	for(int i = 0 ; i < n ; i++)
		cin >> s[i];
	for(int i = -n ; i <= n ; i++){
		for(int j = -n ; j <= n ; j++){
			bool fl = 1;
			for(int x = 0 ; x < n && fl ; x++){
				for(int y = 0 ; y < n && fl ; y++){
					if(s[x][y] != 'o') continue;
					int nx = x + i , ny = y + j;
					fl = (min(nx,ny)<0 || max(nx,ny)>=n || s[nx][ny] != '.');
				}
			}
			if(!fl) continue;
			ans[i+n][j+n] = 1;
			for(int x = 0 ; x < n ; x++){
				for(int y = 0 ; y < n ; y++){
					if(s[x][y] != 'o') continue;
					int nx = x + i , ny = y + j;
					if(min(nx,ny) >= 0 && max(nx,ny) < n)
						vis[nx][ny] = 1;
				}
			}
		}
	}
	for(int i = 0 ; i < n ; i++)
		for(int j = 0 ; j < n ; j++)
			if(s[i][j] == 'x' && !vis[i][j])
				return cout << "NO\n" , 0;
	cout << "YES\n";
	for(int i = 0 ; i < 2*n+1 ; i++){
		for(int j = 0 ; j < 2*n+1 ; j++)
			if(i == n && j == n)
				cout << 'o';
			else
				cout << (ans[i][j] ? 'x' : '.');
		cout << '\n';
	}
}


#include <cstring>
#include <cstdio>
#include <algorithm>

using namespace std;

const int MAXN = 55;

struct Node {
	int x, y;
	Node(int a, int b) {x = a, y = b;}
	Node() {}
} o[MAXN * MAXN];

int n, px, po, m;
char s[MAXN][MAXN], ans[MAXN * 2][MAXN * 2];

int main() {
	scanf("%d", &n);
	for (int i = 1; i <= n; i ++) {
		scanf("%s", s[i] + 1);
		for (int j = 1; j <= n; j ++) {
			if (s[i][j] == 'o') o[++ po] = Node(i, j);
		}
	}
	for (int i = -n + 1; i < n; i ++)
		for (int j = -n + 1; j < n; j ++) {
			if (i == 0 && j == 0) {
				ans[i + n][j + n] = 'o';
				continue;
			}
			bool flag = 1;
			for (int k = 1; k <= po; k ++) {
				int x = o[k].x, y = o[k].y;
				if (x + i >= 1 && x + i <= n && y + j >= 0 && y + j <= n && s[x + i][y + j] == '.') flag = 0;
			}
			if (flag) ans[i + n][j + n] = 'x'; else ans[i + n][j + n] = '.';
		}
	for (int i = 1; i <= 2 * n - 1; i ++) {
		for (int j = 1; j <= 2 * n - 1; j ++)
			printf("%c", ans[i][j]);
		printf("\n");
	}
}


#include <cstring>
#include <cstdio>
#include <algorithm>

using namespace std;

const int MAXN = 55;

struct Node {
	int x, y;
	Node(int a, int b) {x = a, y = b;}
	Node() {}
} o[MAXN * MAXN];

int n, px, po, m, ok[MAXN][MAXN];
char s[MAXN][MAXN], ans[MAXN * 2][MAXN * 2];

int main() {
	scanf("%d", &n);
	for (int i = 1; i <= n; i ++) {
		scanf("%s", s[i] + 1);
		for (int j = 1; j <= n; j ++) {
			if (s[i][j] == 'o') o[++ po] = Node(i, j);
		}
	}
	for (int i = -n + 1; i < n; i ++)
		for (int j = -n + 1; j < n; j ++) {
			if (i == 0 && j == 0) {
				ans[i + n][j + n] = 'o';
				continue;
			}
			bool flag = 1;
			for (int k = 1; k <= po; k ++) {
				int x = o[k].x, y = o[k].y;
				if (x + i >= 1 && x + i <= n && y + j >= 0 && y + j <= n && s[x + i][y + j] == '.') flag = 0;
			}
			if (flag) ans[i + n][j + n] = 'x'; else ans[i + n][j + n] = '.';
			if (flag) {
				for (int k = 1; k <= po; k ++) {
					int x = o[k].x, y = o[k].y;
					if (x + i >= 1 && x + i <= n && y + j >= 0 && y + j <= n && s[x + i][y + j] == 'x') ok[x + i][y + j] = 1;
				}
			}
		}
	bool flag = 0;
	for (int i = 1; i <= n; i ++)
		for (int j = 1; j <= n; j ++) {
			if (s[i][j] == 'x' && !ok[i][j]) flag = 1;
		}
	if (flag) {
		printf("NO\n");
		return 0;
	}
	printf("YES\n");
	for (int i = 1; i <= 2 * n - 1; i ++) {
		for (int j = 1; j <= 2 * n - 1; j ++)
			printf("%c", ans[i][j]);
		printf("\n");
	}
}


/*
Author: Hossam Eissa
Idea:
*/
#include <bits/stdc++.h>
using namespace std;
#define ll  long long
#define FI freopen("input.txt", "r", stdin);
#define FO freopen("o.txt", "w", stdout);
#define start ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
const int INF = 2000000000;
const double PI=acos(-1);
const int N = 1e5+5;
int n;
char mat[51][51];
int mat2[101][101],vis[51][51];
bool ok(int x,int y)
{
    return x>=0&&x<n&&y>=0&&y<n;
}
int main()
{
    start;
    cin>>n;
    for(int i=0; i<101; i++)
        for(int j=0; j<101; j++)
            mat2[i][j]=1;
    for(int i=0; i<n; i++)
        for(int j=0; j<n; j++)
            cin>>mat[i][j];

    for(int i=0; i<n; i++)
        for(int j=0; j<n; j++)
        {
            if(mat[i][j]!='o')continue;
            for(int ii=0; ii<n; ii++)
            {
                for(int jj=0; jj<n; jj++)
                {
                    if(mat[ii][jj]!='.')continue;
                    mat2[ii-i+n-1][jj-j+n-1]=0;
                }
            }
        }

    for(int i=0; i<n; i++)
        for(int j=0; j<n; j++)
        {
            if(mat[i][j]!='o')continue;
            for(int ii=0; ii<2*n-1; ii++)
            {
                for(int jj=0; jj<2*n-1; jj++)
                {
                    int x=i+ii-n+1,y=j+jj-n+1;
                    if(ok(x,y)&&mat2[ii][jj]==1)
                    {
                        vis[x][y]=1;
                    }
                }
            }
        }
    for(int i=0; i<n; i++)
    {
        for(int j=0; j<n; j++)
        {
            if(mat[i][j]=='o')continue;
            if(vis[i][j]&&mat[i][j]=='.'||!vis[i][j]&&mat[i][j]=='X')
            {
                cout<<"NO"<<endl;
                return 0;
            }
        }
    }
    cout<<"YES"<<endl;
    for(int i=0; i<2*n-1; i++)
    {
        for(int j=0; j<2*n-1; j++)
        {
            if(i==n-1&&j==n-1)
            {
                cout<<"o";
            }
            else cout<<".x"[mat2[i][j]];
        }
        cout<<endl;
    }
}


/*
Author: Hossam Eissa
Idea:
*/
#include <bits/stdc++.h>
using namespace std;
#define ll  long long
#define FI freopen("input.txt", "r", stdin);
#define FO freopen("o.txt", "w", stdout);
#define start ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
const int INF = 2000000000;
const double PI=acos(-1);
const int N = 1e5+5;
int n;
char mat[51][51];
int mat2[101][101],vis[51][51];
bool ok(int x,int y)
{
    return x>=0&&x<n&&y>=0&&y<n;
}
int main()
{
    start;
    cin>>n;
    for(int i=0; i<101; i++)
        for(int j=0; j<101; j++)
            mat2[i][j]=1;
    for(int i=0; i<n; i++)
        for(int j=0; j<n; j++)
            cin>>mat[i][j];

    for(int i=0; i<n; i++)
        for(int j=0; j<n; j++)
        {
            if(mat[i][j]!='o')continue;
            for(int ii=0; ii<n; ii++)
            {
                for(int jj=0; jj<n; jj++)
                {
                    if(mat[ii][jj]!='.')continue;
                    mat2[ii-i+n-1][jj-j+n-1]=0;
                }
            }
        }

    for(int i=0; i<n; i++)
        for(int j=0; j<n; j++)
        {
            if(mat[i][j]!='o')continue;
            for(int ii=0; ii<2*n-1; ii++)
            {
                for(int jj=0; jj<2*n-1; jj++)
                {
                    int x=i+ii-n+1,y=j+jj-n+1;
                    if(ok(x,y)&&mat2[ii][jj]==1)
                    {
                        vis[x][y]=1;
                    }
                }
            }
        }
    for(int i=0; i<n; i++)
    {
        for(int j=0; j<n; j++)
        {
            if(mat[i][j]=='o')continue;

            if((vis[i][j]&&mat[i][j]=='.')||(!vis[i][j]&&mat[i][j]=='x'))
            {
                cout<<"NO"<<endl;
                return 0;
            }
        }
    }
    cout<<"YES"<<endl;
    for(int i=0; i<2*n-1; i++)
    {
        for(int j=0; j<2*n-1; j++)
        {
            if(i==n-1&&j==n-1)
            {
                cout<<"o";
            }
            else cout<<".x"[mat2[i][j]];
        }
        cout<<endl;
    }
}