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


*.*.
....
*.*.
....
**
**
**
**
*.*
*.*
...
.....
.**..
.....
.**..
.....
....
....
**..
**..
/* package codechef; // don't place package name! */

import java.util.*;
import java.lang.*;
import java.io.*;

/* Name of the class has to be "Main" only if the class is public. */
public class Codechef
{
    public static class FastIO
	{
		BufferedReader br;
		BufferedWriter bw, be;
		StringTokenizer st;

		public FastIO()
		{
			br = new BufferedReader(new InputStreamReader(System.in));
			bw = new BufferedWriter(new OutputStreamWriter(System.out));
			be = new BufferedWriter(new OutputStreamWriter(System.err));
			st = new StringTokenizer("");
		}

		private void read() throws IOException
		{
			st = new StringTokenizer(br.readLine());
		}

		public String ns() throws IOException
		{
			while(!st.hasMoreTokens())
				read();
			return st.nextToken();
		}

		public int ni() throws IOException
		{
			return Integer.parseInt(ns());
		}

		public long nl() throws IOException
		{
			return Long.parseLong(ns());
		}

		public float nf() throws IOException
		{
			return Float.parseFloat(ns());
		}

		public double nd() throws IOException
		{
			return Double.parseDouble(ns());
		}

		public char nc() throws IOException
		{
			return ns().charAt(0);
		}

		public int[] nia(int n) throws IOException
		{
			int[] a = new int[n];
			for(int i = 0; i < n; i++)
				a[i] = ni();

			return a;
		}

		public long[] nla(int n) throws IOException
		{
			long[] a = new long[n];
			for(int i = 0; i < n; i++)
				a[i] = nl();

			return a;
		}

		public void out(String s) throws IOException
		{
			bw.write(s);
		}

		public void flush() throws IOException
		{
			bw.flush();
			be.flush();
		}

		public void err(String s) throws IOException
		{
			be.write(s);
		}
	}
	 static boolean isPrime(int n)
    {
     // Check if number is less than
       // equal to 1
        if (n <= 1)
            return false;
        // Check if number is 2
        else if (n == 2)
            return true;
        // Check if n is a multiple of 2
        else if (n % 2 == 0)
            return false;
        // If not, then just check the odds
        for (int i = 3; i <= Math.sqrt(n); i += 2) 
        {
            if (n % i == 0)
                return false;
        }
        return true;
    }
     static int gcd(int a, int b)
    {
        if (a == 0)
            return b; 
        return gcd(b % a, a); 
    }
     
    // method to return LCM of two numbers
    static int lcm(int a, int b)
    {
        return (a / gcd(a, b)) * b;
    }
    
    static int smallestDivisor(int n)  
{  
    // if divisible by 2  
    if (n % 2 == 0)  
        return 2;  
  
    // iterate from 3 to sqrt(n)  
    for (int i = 3; i * i <= n; i += 2) {  
        if (n % i == 0)  
            return i;  
    }  
  
    return n;  
}  

	static FastIO f;
	
	public static void main(String args[]) throws IOException
	{
		f = new FastIO();

		int t,i,j;
		
		t = f.ni();
		
		while(t-->0)
		{ int i1=-1;int i2=-1;int j1=-1;int j2=-1;
		    int n=f.ni(); String s[]=new String[n];
		char a[][]=new char[n][n];
   for(i=0;i<n;i++){
      s[i]=f.ns();
   }   for(i=0;i<n;i++){
         for(j=0;j<n;j++){
             a[i][j]=s[i].charAt(j);
             if(a[i][j]=='*') {
                 if(i1==-1){
                     i1=i;j1=j;
                 }
                 else {
                     i2=i;j2=j;
                 }
             }
         }
   } int x=Math.abs(i2-i1);int y=Math.abs(j2-j1);
   if(i1==i2){
       if(i1+1<n){a[i1+1][j1]='*';a[i1+1][j2]='*';}
       else {a[i1-1][j1]='*';a[i1-1][j2]='*';}
   }
   else if(j1==j2){
       if(j1+1<n){a[i1][j1+1]='*';a[i2][j2+1]='*';}
       else {a[i1][j1-1]='*';a[i2][j1-1]='*';}
   }
   else{
       if(j1>j2) {a[i2][j2+y]='*';a[i1][j1-y]='*';}
       else {a[i2][j2-y]='*';a[i1][j1+y]='*';}
   }
   
   for(i=0;i<n;i++){
         for(j=0;j<n;j++){
             f.out(a[i][j]+"");
         }
       f.out("\n");
   }
		
		}
   
		f.flush();
	}
}
