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


*.*.
....
*.*.
....
**
**
**
**
*.*
*.*
...
.....
.**..
.....
.**..
.....
....
....
**..
**..

//..............Learning.........//

import java.util.*;
import java.io.*;
import java.lang.*;
public class B {

static FastReader  sc  = new FastReader();
static PrintWriter out = new PrintWriter(System.out);

public static void main(String[] args) throws Exception {
// try {
//	sieve();
//Arrays.fill(dp, -1);
  int t = sc.nextInt();
  while (t-- > 0)
  B.go();
  out.flush();
// } catch (Exception e) {
//    return;}
}
// >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> Code Starts <<<<<<<<<<<<<<<<<<<<<<<<<<<<< //
static int mod=998244353;
static HashSet<Integer> set=new HashSet<>();
static void go() {
int n=sc.nextInt();
char a[][]=new char[n][n];
int x1=-1;
int y1=-1;
int x2=-1;
int y2=-1;
boolean f=false;
boolean ff=false;
for(int i=0;i<n;i++) {
	String s=sc.next();
	for(int j=0;j<n;j++) {
		a[i][j]=s.charAt(j);
		if(f==false && a[i][j]=='*') {
			x1=i;
			y1=j;
			f=true;
		}
		if(a[i][j]=='*')
		if(i!=x1||j!=y1) {
			x2=i;y2=j;
		}
		
	}
}
//out.println(x1+" "+y1+"-"+x2+" "+y2);
if(x1!=x2&&y1!=y2) {
a[x1][y2]='*';
a[x2][y1]='*';
print(a);
return;
}
if(x1==x2 && y1 !=y2) {
	if(x1==n-1) {
		a[x1-1][y1]='*';
		a[x1-1][y2]='*';
		print(a);
		return;
	}
	if(x1==0) {
		a[x1+1][y1]='*';
		a[x1+1][y2]='*';
		print(a);
		return;
	}
	a[x1-1][y1]='*';
	a[x1-1][y2]='*';
	print(a);
	return;
}
if(x1!=x2 &&y1==y2) {
	if(y1==n-1) {
		a[x1][y1-1]='*';
		a[x2][y1-1]='*';
		print(a);
		return;
	}
	if(y1==0) {
		a[x1][y1+1]='*';
		a[x2][y1+1]='*';
		print(a);
		return;
	}
	a[x1][y1+1]='*';
	a[x2][y1+1]='*';
	print(a);
	return;
}


}
static void   print(char a[][]) {
	
	for(int i=0;i<a.length;i++) {
		for(int j=0;j<a[i].length;j++) {
			out.print(a[i][j]);
		}
		out.println();
	}
}

// >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> Code Ends <<<<<<<<<<<<<<<<<<<<<<<<<<<<< //


static long gcd(long a,long b){
    if(b==0){
        return a;
    }return gcd(b,a%b);
}
static long fact[];
static long invfact[];
static long ncr(int n,int k) {
	if(k<0||k>n) {
		return 0;
	}
	long x=fact[n]%mod;
	long y=invfact[k]%mod;
	long yy=invfact[n-k]%mod;
	long ans=(x*y)%mod;
	ans=(ans*yy)%mod;
	return ans;
}
static int prime[]=new int[1000006];
static void sieve() {
	Arrays.fill(prime, 1);
	prime[0]=0;
	prime[1]=0;
	for(int i=2;i*i<=1000005;i++) {
		if(prime[i]==1)
		for(int j=i*i;j<=1000005;j+=i) {
			prime[j]=0;
		}
	}
	for(int i=1;i<1000005;i++) {prime[i]=prime[i]+prime[i-1];}
}
static void sort(long [] a) {
  ArrayList<Long> aa = new ArrayList<>();
  for (long  i : a) {
    aa.add(i);
  }Collections.sort(aa);  for (int i = 0; i < a.length; i++)
    a[i] = aa.get(i);	  }
static void sort(int [] a) {
  ArrayList<Integer> aa = new ArrayList<>();
  for (int  i : a) {
    aa.add(i);
  } Collections.sort(aa); for (int i = 0; i < a.length; i++)
    a[i] = aa.get(i); }
static long pow(long x, long y) {
  long res = 1l;
  while (y != 0) {
    if (y % 2 == 1) {
      res = (x%mod * res%mod)%mod; } y /= 2; x = (x%mod * x%mod)%mod;
  } return res%mod;  }

//>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> Fast IO <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< //

static class FastReader {
  BufferedReader  br;
  StringTokenizer st;public FastReader() {
    br = new BufferedReader(new InputStreamReader(System.in));
  }  String next() {
    while (st == null || !st.hasMoreElements()) {
      try { st = new StringTokenizer(br.readLine());
      } catch (IOException e) {
        e.printStackTrace();
      }  } return st.nextToken();
  } int nextInt() {
    return Integer.parseInt(next());
  } long nextLong() {
    return Long.parseLong(next());
  }double nextDouble() {
    return Double.parseDouble(next());
  } String nextLine() {
    String str = "";
    try {
      str = br.readLine();
    } catch (IOException e) {
      e.printStackTrace();
    }
    return str;
  }}
}
class two implements Comparable<two>{
	int val;int ind;
	two(int val,int ind){
		this.val=val;
		this.ind=ind;
	}
	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ind;
		result = prime * result + val;
		return result;
	}
	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		two other = (two) obj;
		if (val != other.val)
			return false;
		return true;
	}
	@Override
	public int compareTo(two o) {
		if(this.val==o.val) {
			return Integer.compare(this.ind, o.ind);
		}
		return -Integer.compare(o.val, this.val);
	}

}


/*
 * imp log method using math function is somewhat inaccurate to check power of
 * two
 *
 */