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


*.*.
....
*.*.
....
**
**
**
**
*.*
*.*
...
.....
.**..
.....
.**..
.....
....
....
**..
**..
/*
ID: tommyfa1
TASK : ride
LANG : C++11
*/


#include <iostream>
#include <unordered_map>
#include <map>
#include <algorithm>
#include <set>
#include <deque>          
#include <list>
#include <fstream>
#include <string>
#include <vector>
#include <sstream>
#include <array>
#include <queue>
#include <stack>
#include <unordered_set>
#include <utility> 
#include <iomanip>
#include <math.h>
#include <cmath>


#define lli long long int
#define li long int
#define lld long long double
#define ld long double
#define For(i, a, b) for (int i=a; i<b; i++)
#define trav(a,b) for (auto a:b)
#define Rof(i, a, b) for (int i=a; i>=b; i--)
#define Sort(v) sort(v.begin(), v.end()) 
#define Sortg(v) sort(v.begin(), v.end(),greater<int>())
#define Reverse(v) reverse(v.begin(), v.end())
#define V(n) vector<int>v(n)
#define MOD 1000000007
# define pi 3.14159265358979323846
#define upperbound(v,n) upper_bound(v.begin(),v.end(),n)
#define lowerbound(v,n) lower_bound(v.begin(),v.end(),n)
#define vi vector<int>

using namespace std;


/*
Usaco:
ofstream cout("wormsort.out");
ifstream cin("wormsort.in");

floodfill:
int dy[4] = { 1,0,-1,0 };         //0=D 1=R 2=U 3=L
int dx[4] = { 0,1,0,-1 };

sorting:
bool cmp(const pair<int, int> & a, const pair<int, int> & b) {
	return a.first > b.first; //greater int
}

get rid of exponentiation-CODEFORCES!
cout <<setprecision(9) << showpoint << fixed;
cout<<_____<<endl;

trials:
int o; cin >> o;
For(z, 0, o) {

}
*/




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

	
	
	int o; cin >> o;
	For(z, 0, o) {
		int n; cin >> n;

		bool first = true; int x1, x2, y1, y2;
		For(i, 0, n) {
			string s; cin >> s;
			For(j, 0, s.size()) {
				if (s[j] == '*' ) {
					if (first) {
						x1 = i; y1 = j; first = false;
					}
					else {
						x2 = i; y2 = j;
					}
				}
			}
		}

		///*
		int x1r, x2r, y1r, y2r;
		if (x1 == x2) {
			if (x1 - 1 < 0) {
				x1r = x1 + 1; x2r = x2 + 1; y1r = y1; y2r = y2;
			}
			else {
				x1r = x1 -1; x2r = x2 -1; y1r = y1; y2r = y2;
			}
		}
		else if (y1 == y2) {
			if (y1 - 1 < 0) {
				x1r = x1; x2r = x2; y1r = y1+1; y2r = y2+1;
			}
			else {
				x1r = x1; x2r = x2; y1r = y1-1; y2r = y2-1;
			}
		}
		else if (x1 < x2 && y1 < y2) {
			x1r = x2; x2r = x1; y1r = y1; y2r = y2;
		}
		else {
			x1r = x1; x2r = x2; y1r = y2; y2r = y1;
		}

		//cout << x1 << " " << y1 << " " << x2 << " " << y2 << endl;
		//cout << x1r << " " << y1r << " " << x2r << " " << y2r << endl;

		///*
		For(i, 0, n) {
			For(j, 0, n) {
				if (i == x1r && j == y1r)cout << '*';
				else if (i == x2r && j == y2r)cout << '*';
				else if (i == x1 && j == y1)cout << '*';
				else if (i == x2 && j == y2)cout << '*';
				else cout << '.';
			}
			cout << endl;
		}
		//*/




	}


	
	



	return 0;
	//fout.close();
}






