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.*;
import java.util.*;

public class Solution {
    private static final fast sc = new fast();
    private static final BufferedWriter sout = 
        new BufferedWriter(new OutputStreamWriter(System.out));
    private static final int OO = (int) 1e2 + 1;
    private static final double PI = 3.141592653;
    private static final int[] dx4 = {0, 1, 0, -1}, dx = {0, 0, 1, -1, 1, -1, 1, -1};
    private static final int[] dy4 = {1, 0, -1, 0}, dy = {1, -1, 0, 0, 1, -1, -1, 1};
    //static void print6P{ System.out.printf("%8.6f\n"); }
    
    public static void main(String[] args) throws IOException {
        int t =sc.nextInt();
        while(t-->0){
            int n =sc.nextInt(),x1=-1,y1=-1,x2=-1,y2=-1;
            char[][] grid =new char[n][n];
            for(int i =0 ;i <n;i++){
                String s =sc.next();
                for(int j =0;j<n;j++){
                    grid[i][j] =s.charAt(j);
                    if(grid[i][j]=='*'){
                        if(x1==-1 && y1==-1){
                            x1 =i;
                            y1 =j;
                        }else {
                            x2 =i;
                            y2 =j;
                        }
                    }
                }
            }
            int x3,y3,x4,y4;
            if(y1 == y2){
                if(y1!=0){
                    x3 =Math.min(x1,x2);y3 =0;
                    x4 =Math.max(x1,x2);y4 =0;
                }else{
                    x3 =Math.min(x1,x2);y3 =n-1;
                    x4 =Math.max(x1,x2);y4 =n-1;
                }
            }else if(x1==x2){
                if(x1==0){
                    x3 =n-1;y3 =Math.min(y1,y2);
                    x4 =n-1;y4 =Math.max(y1,y2);
                }else{
                    x3 =0;y3 =Math.min(y1,y2);
                    x4 =0;y4 =Math.max(y1,y2);
                }
            }else if(x1<x2&&y1<y2){
                x3 =Math.min(x1,x2);y3 =Math.max(y1,y2);
                x4 =Math.max(x1,x2);y4 =Math.min(y1,y2);
            }else{
                x3 =Math.min(x1,x2);y3 =Math.min(y1,y2);
                x4 =Math.max(x1,x2);y4 =Math.max(y1,y2);
            }
            grid[x3][y3] ='*';
            grid[x4][y4] ='*';
            for(int i =0 ;i <n;i++){
                for(int j =0;j<n;j++){
                    sout.write(grid[i][j]+"");
                }
                sout.write("\n");
            }
           // sout.write(x1+" "+y1+" "+x2+" "+y2+"\n");
        }
      
        sout.close();
    }
    
    static boolean isPrime(long number){
        if (number < 2) {
            return false;
        }
        if (number % 2 == 0){
            return (number == 2);
        } 
        //int root = (int)Math.Sqrt((double)number);
        for (int i = 3; i*i <= number; i += 2){
            if (number % i == 0){
                return false;
            } 
        }
        return true;
    }
    static long gcd(long a, long b) {
      if (a == 0)
            return b;
        return gcd(b % a, a);
    }
    static long lcm(long a, long b){
        return (a / gcd(a, b)) * b;
    }
    static class fast {
        BufferedReader br;
        StringTokenizer st;

        public fast() {
            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());
        }

        double nextFloat() {
            return Float.parseFloat(next());
        }

        String nextLine() {
            String str = "";
            try {
                str = br.readLine();
            } catch (IOException e) {
                e.printStackTrace();
            }
            return str;
        }
    }
    static class Pair implements Comparable<Pair> {
        int first;
        int second;

        Pair(int first, int second) {
            this.first = first;
            this.second = second;
        }

        @Override
        public int compareTo(Pair o) {
            return Double.compare(o.first, first);
        }

        @Override
        public boolean equals(Object o) {
            if (this == o) {
                return true;
            }
            if (!(o instanceof Pair)) {
                return false;
            }
            Pair pair = (Pair) o;
            if (first != pair.first) {
                return false;
            }
            return second == pair.second;
        }
    }
    static class Triple implements Comparable<Triple> {
        int first;
        int second;
        int third;

        Triple(int first, int second, int third) {
            this.first = first;
            this.second = second;
            this.third = third;
        }

        @Override
        public int compareTo(Triple o) {
           
             return Double.compare(o.second, second);
            
        }
    }
}