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


*.*.
....
*.*.
....
**
**
**
**
*.*
*.*
...
.....
.**..
.....
.**..
.....
....
....
**..
**..
/*
ID: davidzh8
PROG: subset
LANG: JAVA
 */

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

public class brick {
    //Start Stub
    static long startTime = System.nanoTime();

    public static void main(String[] args) throws IOException {
        boolean debug = (true);
        FastScanner sc = new FastScanner("swap.in", debug);
        FastWriter pw = new FastWriter("swap.out", debug);
        int tcs = sc.ni();
        while(tcs-->0){
            int N = sc.ni();
            char matrix[][]= new char[N][N];
            Pair first= new Pair(-1, -1);
            Pair second = new Pair(-1, -1);
            for(int i=0; i<N; i++){
                char[] line = sc.next().toCharArray();
                for(int j=0; j<N; j++){
                    matrix[i][j]= line[j];
                    if(line[j]=='*'){
                        if(first.a == -1) first = new Pair(i, j);
                        else second = new Pair(i,j);
                    }
                }
            }
            //if they are both not in same column or same row
            // they are adjacent
            if(first.a != second.a && first.b!=second.b){
                // first. a is always smaller

                    matrix[first.a][second.b]='*';
                    matrix[second.a][first.b] ='*';


            }
            // same row
            if(first.a== second.a){
                if(first.a+1<N){
                    matrix[first.a+1][first.b] = '*';
                    matrix[second.a+1][second.b] = '*';
                }
                else if(first.a-1>=0){
                    matrix[first.a-1][first.b] = '*';
                    matrix[second.a-1][second.b] = '*';
                }
            }
            // same col
            if(first.b == second.b){
                if(first.b+1<N){
                    matrix[first.a][first.b+1] = '*';
                    matrix[second.a][second.b+1] = '*';
                }
                else if(first.b-1>=0){
                    matrix[first.a][first.b-1] = '*';
                    matrix[second.a][second.b-1] = '*';
                }
            }
            for(int i=0; i<N; i++){
                for(int j=0; j<N; j++){
                    System.out.print(matrix[i][j]);
                }
                System.out.println();
            }
        }
        pw.close();
    }


    static class Edge implements Comparable<Edge> {
        int w;
        int a;
        int b;

        public Edge(int w, int a, int b) {
            this.w = w;
            this.a = a;
            this.b = b;

        }

        public int compareTo(Edge obj) {
            if (obj.w == w) {
                if (obj.a == a) {
                    return b - obj.b;
                }
                return a - obj.a;
            } else return w - obj.w;
        }
    }

    static class Pair implements Comparable<Pair> {
        int a;
        int b;

        public Pair(int a, int b) {
            this.a = a;
            this.b = b;
        }

        public int compareTo(Pair obj) {
            if (obj.a == a) {
                return b - obj.b;
            } else return a - obj.a;
        }
    }



    static class FastScanner {
        public BufferedReader br;
        public StringTokenizer st;
        public InputStream is;

        public FastScanner(String name, boolean debug) throws IOException {
            if (debug) {
                is = System.in;
            } else {
                is = new FileInputStream(name);
            }
            br = new BufferedReader(new InputStreamReader(is), 32768);
            st = null;
        }


        public String next() {
            while (st == null || !st.hasMoreTokens()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return st.nextToken();
        }

        public int ni() {
            return Integer.parseInt(next());
        }

        public long nl() {
            return Long.parseLong(next());
        }

        public double nd() {
            return Double.parseDouble(next());
        }

        public String nextLine() {
            String str = "";
            try {
                str = br.readLine();
            } catch (IOException e) {
                throw new RuntimeException(e);
            }
            return str;
        }
    }

    static class FastWriter {
        public PrintWriter pw;

        public FastWriter(String name, boolean debug) throws IOException {
            if (debug) {
                pw = new PrintWriter(System.out);
            } else {
                pw = new PrintWriter(new BufferedWriter(new FileWriter(new File(name))));
            }
        }

        public void println(Object text) {
            pw.println(text);
        }

        public void print(Object text) {
            pw.print(text);
        }

        public void close() {
            pw.close();
        }

        public void flush() {
            pw.flush();
        }
    }

}