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


*.*.
....
*.*.
....
**
**
**
**
*.*
*.*
...
.....
.**..
.....
.**..
.....
....
....
**..
**..
//SHIVAM GARG
import java.util.*;
import java.lang.*;
import java.io.*;


public class Codechef
{
 public static FastReader reader = new FastReader();
 
 
 public static void main (String[] args) throws java.lang.Exception {

        int nn = reader.nextInt();
        for(int ii=0; ii<nn; ii++){
            int n = reader.nextInt();
            boolean[][] mat = new boolean[n][n];
            boolean first_found = false;
            
            int fx=0,fy=0;
            int sx=0,sy=0;
            for(int i=0; i<n; i++){
                char[] chrs = reader.nextLine().toCharArray();
                
                for(int j =0; j<n; j++){
                    if(chrs[j] == '*'){
                        mat[i][j] = true;
                        if(first_found == false){
                            first_found = true;
                            fx = i;
                            fy =j;
                            // System.out.println( "first, i= "+fx+" j=" + fy);
                        }else{
                            sx= i;
                            sy =j;
                            // System.out.println( "second, i= "+sx+" j=" + sy);
                        }
                    }
                }
            }
            if(fx == sx || fy == sy){
                int diff;
                if(fx == sx){
                    diff = Math.abs(fy-sy);
                    if(fx-1 >=0){
                        mat[fx-1][fy] = true;
                        mat[sx-1][sy] = true;    
                    }else{
                        mat[fx+1][fy] = true;
                        mat[sx+1][sy] = true;    
                    }
                }else {
                    diff = Math.abs(fx-sx);
                    if(fy-1 >=0){
                        mat[fx][fy-1] = true;
                        mat[sx][fy-1] = true;    
                    }else{
                        mat[fx][fy+diff] = true;
                        mat[sx][fy+diff] = true;    
                    }       
                }
            }else{
                mat[fx][sy] = true;
                mat[sx][fy] = true;    
            }
            
            
            for(int i=0; i<n; i++){
                for(int j=0; j<n; j++){
                    System.out.print(mat[i][j]? '*' : '.');
                }
                System.out.println();
            }
            
            
        }
    }

    
    static int[] primes;
    
    public static void sieve(){
        primes = new int[100002]; // 0 means prime and 1 means Not prime
        int temp = 2;
        while(temp < primes.length ){
            primes[temp] = 1;
            temp = temp+2;
        }
        primes[2] = 0;
        
        for(int i = 3; i < primes.length; i = i+2){
            if(primes[i] == 0 ){
                temp = i+i;
                while(temp < primes.length ){
                    primes[temp] = 1;
                    temp = temp+i;
                }
            }
        }
    }
    
 
 
 
	
    
    
    public static HashMap<Integer, Integer> getFactors(long n){
        long ori = n;
        
        HashMap<Integer, Integer>  factors = new HashMap<Integer, Integer>();
        int temp =0;
        while(n % 2 == 0 ){
            temp++;
            n = n/2;
        }
        if(temp >0){
            factors.put(2, temp);
            // System.out.println( ori+" ==> " + 2 +" :: " + temp);
        }
        
        long sqrt = (long) Math.sqrt(n);
        for(int i= 3;(i <= sqrt) && i<=n ; i = i+2){
            if(primes[i] == 0 ){
                temp = 0;
                while(n % i == 0 ){
                    temp++;
                    n = n/i;
                }
                if(temp > 0){
                    // System.out.println( ori+" ==> " + i +" :: " + temp);
                    factors.put(i, temp);    
                }
                
            }
        }
        return factors;
        
    }
   
    
 
 /* Iterative Function to calculate  (x^y)%p in O(log y) */
 
    public static long prime = 1000000007;
    public static long[] fact;
    static long power(long x, long y) 
    { 
        // Initialize result 
        long res = 1; 
        // Update x if it is more than or 
        // equal to p 
        x = x % prime; 
                      
        while (y > 0) 
        { 
            // If y is odd, multiply x  with result 
            if (y % 2 == 1) 
                res = (res * x) % prime; 
            // y must be even now 
            y = y >> 1; // y = y/2 
            x = (x * x) % prime; 
        } 
          
        return res; 
    } 
      
    // Returns n^(-1) mod p 
    static long modInverse(long n) 
    {   return power(n, prime-2);   } 
      
    // Returns nCr % p using Fermat's little theorem. 
    static long nCrModPFermat(int n, int r) 
    { 
        // Base case 
        if (r == 0) 
            return 1; 
        long a1 = fact[n];
        long a2 = modInverse(fact[r]) % prime;
        long a3 = modInverse(fact[n-r]) % prime;
        return ((fact[n] * a2)%prime * a3) % prime; 
    } 
	
	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());  } 
        
        int[] nextIntArray(int n){
            int[] arr = new int[n];
            for(int ii=0; ii<n; ii++){
                arr[ii] = this.nextInt();
            }
            return arr;
        }
        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; 
        } 
    } 
	
	
}