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;
 typedef long long ll;
  
 typedef vector<int> vi;
 typedef vector<ll> vl;
 typedef vector<vi> vvi;
 typedef set<int> si;
 typedef set<ll> sl;
 typedef queue<int> qi;
 typedef queue<ll> ql;
 typedef stack<int> sti;
 typedef deque<int> dqi;
 typedef priority_queue<int> pqi;
 typedef priority_queue<ll> pql;
 typedef deque<ll> dql;
 typedef vector<vl> vvl;
 typedef pair<int,int> pii;
 typedef pair<double, double> pdd;
 typedef pair<ll, ll> pll;
 typedef vector<pii> vpi;
 typedef vector<pll> vll;
 typedef double dl;
                    
 #define PB push_back
 #define ins insert
 #define F first
 #define S second
 #define MP make_pair
 #define el  '\n'
 #define sl(x) (int)x.length()
 #define all(a) (a).begin(),(a).end()
 #define sz(x) (int)x.size()
 #define mid(l,r) ((r+l)/2)
 #define left(node) (node*2)
 #define right(node) (node*2+1)
 #define mx_int_prime 999999937
 #define lp(i,n)        for(int i=0;i<n;i++) 
 #define out(x)  cout<<x<<el
 const double PI = acos(-1);
 const double eps = 1e-9;
 const int inf = 2000000000;
 const ll infLL = 9000000000000000000;
 #define MOD 1000000007
 #define in(n)  ll n;cin>>n         
 #define mem(a,b) memset(a, b, sizeof(a) )
 #define gcd(a,b) __gcd(a,b)
 #define sqr(a) ((a) * (a))
#define FAST  ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0); 
 #define fraction(a) cout.unsetf(ios::floatfield); cout.precision(a); cout.setf(ios::fixed,ios::floatfield);
 typedef vector<int>::iterator vit;
 typedef set<int>::iterator sit;
 int dx[] = {0, 0, +1, -1};
 int dy[] = {+1, -1, 0, 0};
   
  
void solve(){
     int n, m ;
    cin>>n ;
    vi s,p;
     vector<string>v;
     for(int i=0;i<n;i++){
         string s;
         cin>>s;
         v.PB(s);
     }
  for(int i=0;i<n;i++){
      for(int j=0;j<v[i].length();j++){
          if(v[i][j]=='*'){
              s.PB(i);
              p.PB(j);
          }
      }
  }
  int x=s[0];
  int y=s[1];

  int z=p[0];
  int w=p[1];
 if(x==y){
  if(x==n-1){
      v[x-1][z]='*';
      v[y-1][w]='*';
  }
else{
 v[x+1][z]='*';
 v[x+1][w]='*';
}
 }
 else if(x!=y&&z==w){
     if(z==v[x].length()-1){
         v[x][z-1]='*';
         v[y][w-1]='*';

     }
     else {
         v[x][z+1]='*';
         v[y][w+1]='*';
     }

 }
 else {
     v[x][w]='*';
     v[y][z]='*';
 }
  for(int i=0;i<n;i++)cout<<v[i]<<el;
 
 

}
int main(){
     FAST
    int t=1;
    cin>>t;
  while(t--)
    solve();
    
    
 
}