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


*.*.
....
*.*.
....
**
**
**
**
*.*
*.*
...
.....
.**..
.....
.**..
.....
....
....
**..
**..
import java.io.BufferedOutputStream;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.*;

public class Main {
	
	public static int count = 0;
	public static class Scanner {
	    BufferedReader br;
	    StringTokenizer st;
	    public Scanner() {
	       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;
	    }

	}
	
	public static void print(int[] arr) {
		for(int i=0 ; i<arr.length ; i++) System.out.print(arr[i]+" ");
		System.out.println();
	}
	
	public static void print(int[][] arr) {
		for(int i=0 ; i<arr.length ; i++) {
			for(int j=0 ; j<arr[0].length ; j++) System.out.print(arr[i][j]+" ");
			System.out.println();
		}
	}
	
	public static void flush() {
		System.out.flush();
	}
	
	
	public static boolean isPalindrome(String str) {
		for (int i = 0 ; i < str.length() ; i++) { 
			if (str.charAt(i) != str.charAt(str.length() - i - 1))
				return false;
		}
		return true;
	}
	
	public static class Pair {
		int x;
		int y;
		Pair(int x, int y) {
			this.x = x;
			this.y = y;
		}
		Pair(Pair p) {
			x = p.x;
			y = p.y;
		}
	}
	static class cmp implements Comparator<int[]> {
		public int compare(int[] arr1 , int[] arr2) {
			if (arr1[0] > arr2[0])
				return 1;
			return -1;
		}
//		Arrays.sort(data,new Comparator<int[]>() {
//		public int compare(int[] a,int[] b) {
//			return Integer.compare(a[0], b[0]);
//		}
//	});
	}
	
	public static void solve(Scanner s) {
		//PrintWriter out = new PrintWriter(new BufferedOutputStream(System.out));
		int n = s.nextInt();
		//int m = s.nextInt();
		//int k1 = s.nextInt();
		//int k2 = s.nextInt();
		//int w = s.nextInt();
		//int b = s.nextInt();
		//String s1 = s.nextLine();
		//String s2 = s.nextLine();
		//int[][] dp = new int[n * m][2];
//		long[] arr = new long[n];
//		for (int i = 0 ; i < n ; i++) 
//			arr[i] = s.nextLong();
		//int[][] data=new int[n][2];
		String[] arr = new String[n];
		char[][] data = new char[n][n];
		for (int i = 0 ; i < n ; i++) 
			arr[i] = s.nextLine();
		Pair p1 = new Pair(0 , 0);
		Pair p2 = new Pair(0 , 0);
		int count = 0;
		for (int i = 0 ; i < n ; i++) {
			for (int j = 0 ; j < n ; j++) {
				if (arr[i].charAt(j) == '*') { 
					if (count == 0) 
						p1 = new Pair(i , j);
					else 
						p2 = new Pair(i , j);
					count += 1;
				}
				data[i][j] = arr[i].charAt(j);
			}
		}
		if (p1.x == p2.x) {
			if (p1.x == 0) {
				data[p1.x + 1][p1.y] = '*';
				data[p1.x + 1][p2.y] = '*';
			} else {
				data[p1.x - 1][p1.y] = '*';
				data[p1.x - 1][p2.y] = '*';
			}
		} else if (p1.y == p2.y) {
			if (p1.y == 0) {
				data[p1.x][p1.y + 1] = '*';
				data[p2.x][p2.y + 1] = '*';
			} else {
				data[p1.x][p1.y - 1] = '*';
				data[p2.x][p2.y - 1] = '*';
			}
		} else {
			data[p1.x][p2.y] = '*';
			data[p2.x][p1.y] = '*';
		}
		for (int i = 0 ; i < n ; i++) {
			for (int j = 0 ; j < n ; j++) {
				System.out.print(data[i][j]);
			}
			System.out.println();
		}
		
		
	}
	public static void main(String[] args) {
		Scanner s = new Scanner();
	    //PrintWriter out = new PrintWriter(new BufferedOutputStream(System.out));
	    int t = s.nextInt();
	    //s.nextLine();
	    while(t-->0) { 
	    	solve(s);
	    	
	    }
		
		//e(s);
	    
	    //int n      = s.nextInt();        // read input as integer
	    //long k     = s.nextLong();       // read input as long
	    //double d   = s.nextDouble();     // read input as double
	    //String str = s.next();           // read input as String
	    //String str2  = s.nextLine();       // read whole line as String

	    //long result = 3*k;
	    //out.println(result);                    // print via PrintWriter
	   
	    //out.close();

	}
}

