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

public class Main
{
    public static void main(String[] args) throws IOException {
        OutputStream outputStream = System.out;
        FastReader in = new FastReader();
        PrintWriter out = new PrintWriter(outputStream);
        PROBLEM solver = new PROBLEM();
        int t=1;
        t = in.nextInt();
        for(int i=0;i<t;i++){
            solver.solve(in, out);
        }
        out.close();
    }
    static class PROBLEM
    {
        public void solve(FastReader in,PrintWriter out) {

            int n = in.nextInt();
            int flag = 1, r1 = 0, r2 =0, c1 = 0, c2 = 0;
            char[][] s = new char[n][n];

            for (int i = 0; i < n; i++) {
                s[i] = in.nextLine().toCharArray();
            }

            for (int i = 0; i < n; i++) {
                for (int j = 0; j < n; j++) {

                    if(s[i][j] == '*'){
                        if(flag == 1){
                            r1 = i;
                            c1 = j;
                            flag = 2;
                        }else{
                            r2 = i;
                            c2 = j;
                        }
                    }
                }
            }

            if(r1 == r2){
                if(r1 > 0){
                    s[0][c1] = '*';
                    s[0][c2] = '*';
                }
                else{
                    s[1][c1] = '*';
                    s[1][c2] = '*';
                }
            }else if(c1 == c2){
                if(c1 > 0){
                    s[r1][0] = '*';
                    s[r2][0] = '*';
                }else{
                    s[r1][1] = '*';
                    s[r2][1] = '*';
                }
            }else{
                s[r1][c2] = '*';
                s[r2][c1] = '*';
            }

            for (int i = 0; i < n; i++) {
                for (int j = 0; j < n; j++) {
                    out.print(s[i][j]);
                }
                out.println();
            }
            





//            int n = in.nextInt();
//            int[] a = new int[n];
//
//            for (int i = 0; i < n; i++) {
//                a[i] = in.nextInt();
//            }
//
//            int[] b = new int[n];
//            int i = 0;
//            while(i<n-1){
//                int flag = 0;
//                for (int j = i+1; j < n; j++) {
//                        if (a[j] < a[i]) {
//                            flag = 1;
//                            b[i] = j - i - 1;
//                        }
//
//                }
//                if(flag == 0){
//                    b[i] = -1;
//                }
//                i++;
//            }
//
//            b[n-1] = -1;
//
//            for (int j = 0; j < n; j++) {
//                out.print(b[j] + " ");
//            }





        }
    }

    private static boolean palindrome(char[] a){

        boolean isPalindrome = true;
        for (int i = 0; i < a.length/2; i++) {
            if(a[i] != a[a.length-i-1]){
                isPalindrome = false;
                break;
            }
        }

        return isPalindrome;

    }

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

        long nextLong() {
            return Long.parseLong(next());
        }

        double nextDouble() {
            return Double.parseDouble(next());
        }

        char nextChar() {
            return next().charAt(0);
        }

        boolean nextBoolean() {
            return !(nextInt() == 0);
        }
        // boolean nextBoolean(){return Boolean.parseBoolean(next());}

        String nextLine() {
            String str = "";
            try {
                str = br.readLine();
            } catch (IOException e) {
                e.printStackTrace();
            }
            return str;
        }

    }

    private static int[] mergeSort(int[] array){

        if(array.length <= 1){
            return array;
        }

        int midpoint = array.length / 2;

        int[] left = new int[midpoint];
        int[] right;

        if(array.length % 2 == 0){
            right = new int[midpoint];
        }else{
            right = new int[midpoint + 1];
        }

        for (int i = 0; i < left.length; i++) {
            left[i] = array[i];
        }

        for (int i = 0; i < right.length; i++) {
            right[i] = array[i + midpoint];
        }

        int[] result = new int[array.length];

        left = mergeSort(left);
        right = mergeSort(right);

        result = merge(left, right);

        return result;
    }

    private static int[] merge(int[] left, int[] right){

        int[] result = new int[left.length + right.length];
        int leftPointer = 0, rightPointer = 0, resultPointer = 0;

        while(leftPointer < left.length || rightPointer < right.length){

            if(leftPointer < left.length && rightPointer < right.length){

                if(left[leftPointer] < right[rightPointer]){
                    result[resultPointer++] = left[leftPointer++];
                }else{
                    result[resultPointer++] = right[rightPointer++];
                }
            }else if(leftPointer < left.length){
                result[resultPointer++] = left[leftPointer++];
            }else{
                result[resultPointer++] = right[rightPointer++];
            }
        }
        return result;
    }
}
