There is a square field of size n × n in which two cells are marked. These cells can be in the same row or column.

You are to mark two more cells so that they are the corners of a rectangle with sides parallel to the coordinate axes.

For example, if n=4 and a rectangular field looks like this (there are asterisks in the marked cells):

$$$ \begin{matrix} . & . & * & . \\\ . & . & . & . \\\ * & . & . & . \\\ . & . & . & . \\\ \end{matrix} $$$

Then you can mark two more cells as follows

$$$ \begin{matrix} * & . & * & . \\\ . & . & . & . \\\ * & . & * & . \\\ . & . & . & . \\\ \end{matrix} $$$

If there are several possible solutions, then print any of them.

Input

The first line contains a single integer t (1 ≤ t ≤ 400). Then t test cases follow.

The first row of each test case contains a single integer n (2 ≤ n ≤ 400) — the number of rows and columns in the table.

The following n lines each contain n characters '.' or '*' denoting empty and marked cells, respectively.

It is guaranteed that the sums of n for all test cases do not exceed 400.

It is guaranteed that there are exactly two asterisks on the field. They can be in the same row/column.

It is guaranteed that the solution exists.

Output

For each test case, output n rows of n characters — a field with four asterisks marked corresponding to the statements. If there multiple correct answers, print any of them.

Example

Input


6
4
..*.
....
*...
....
2
*.
.*
2
.*
.*
3
*.*
...
...
5
.....
..*..
.....
.*...
.....
4
....
....
*...
*...


Output


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

#define ll long long
#define fi first
#define se second
#define f(i,n) for(int i=0;i<n;i++)
#define fr(i,m,n) for(int i=m;i<n;i++)
#define fe(i,n) for(int i=n-1;i>=0;i--)
#define pii pair<int,int>
#define vi vector<int>
#define vii vector<pii>
#define qii queue<int>
#define pb push_back

const int N=1e5+1;
const int MOD=1e9+7;

vi ar(200001);
int n;

vi take(int n){
    vi a(n);
    f(i,n)cin>>a[i];
    return a;
}

template<typename p>
p power(p a,p n){
    p ans = 1;
    while(n){
        if(n&1)ans *= a;
        a = a * a;
        n >>= 1;
    }
    return ans;
}

template<typename p>
p mpower(p a,p n){
    p ans = 1;
    while(n){
        if(n&1)ans = (ans*a)%MOD;
        a = (a * a)%MOD;
        n >>= 1;
    }
    return ans;
}

int dfs(int x,int pv,vector<vi>& v){
    if(v[x].size()==1&&v[x][0]==pv){ar[x]=n-1;return 1;}
    int an = 1;
    for(int y:v[x]){
        if(y==pv)continue;
        int tp = dfs(y,x,v);
        an += tp;
        ar[x] = max(ar[x],tp);
    }
    ar[x] = max(ar[x],n-an);
    return an;
}

int dp1[1000][1000];
int dp2[1000][1000];



int fn(int k,int i,int bn){
    if(k==0)return 0;
    if(k==1)return 1;
    if(bn==0&&dp1[k][i]!=-1)return dp1[k][i];
    if(bn==1&&dp2[k][i]!=-1)return dp2[k][i];

    if(bn){
            int temp = 0;
        for(int j=i+1;j<n;j++){
            temp = (temp+fn(k-1,j,0))%MOD;
        }
            return dp2[k][i] = (1+temp)%MOD;
    }
    else{
        int temp = 0;
        for(int j=i-1;j>=0;j--){
            temp = (temp+fn(k-1,j,1))%MOD;
        }
            return dp1[k][i] = (1+temp)%MOD;
    }
}

void solve(){
    int m;
    cin>>m;
    vector<vector<char>> a(m);
    char x;
    int k=-1,l,p,q;
    f(i,m){f(j,m){cin>>x;a[i].pb(x);if(x=='*'&&k==-1){k=i;l=j;}else if(x=='*'){p=i;q=j;}}}
    if(k==p){
        if(k+1<m){
            a[k+1][l] = a[k+1][q] = '*';
        } else {
            a[k-1][l] = a[k-1][q] = '*';
        }
    }
    else if(l==q){
        if(l+1<m){
            a[k][l+1] = a[p][l+1] = '*';
        } else {
            a[k][l-1] = a[p][q-1] = '*';
        }
    } else {
        a[k][q] = a[p][l] = '*';
    }
    f(i,m){{f(j,m)cout<<a[i][j];}cout<<endl;}
}




int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    int t;cin>>t;

    while(t--){
            solve();
    }
}

