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.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

import java.util.Arrays;
import java.util.StringTokenizer;

import static java.lang.System.in;
import static java.lang.System.out;

public class Main{
    final static int INF=Integer.MAX_VALUE;
    final static int nINF=Integer.MIN_VALUE;
    final static long MOD=1000000007;

    public static void main(String[] args){
        FastReader fr=new FastReader();
        int tc=fr.nextInt();
        while(tc-->0){
            int n=fr.nextInt();
            char a[][]=new char[n][n];

            int f=0;
            int ax=-1,ay=-1;
            int bx=-1,by=-1;

            for(int i=0;i<n;i++){
                a[i]=fr.nextLine().toCharArray();
                for(int ci=0;ci<n;ci++){
                    if(a[i][ci]=='*'){
                        if(f==0){
                            ax=i;
                            ay=ci;
                            f++;
                        }else{
                            bx=i;
                            by=ci;
                        }
                    }
                }
            }

//            out.println(ax+" "+ay);
//            out.println(bx+" "+by);

            if(ax==bx){
                if(ax+1<n){
                    a[ax+1][ay]='*';
                    a[bx+1][by]='*';
                }else{
                    a[ax-1][ay]='*';
                    a[bx-1][by]='*';
                }
            }else if(ay==by){
                if(ay+1<n){
                    a[ax][ay+1]='*';
                    a[bx][by+1]='*';
                }else{
                    a[ax][ay-1]='*';
                    a[bx][by-1]='*';
                }
            }else{
                a[ax][by]='*';
                a[bx][ay]='*';
            }

            for(int i=0;i<n;i++){
                out.println(new String(a[i]));
            }
        }
    }

    ///////////////////////////////////////////////////////////

    static int[] fillInt(int n,FastReader fr){
        int ret[]=new int[n];
        for(int i=0;i<n;i++){
            ret[i]=fr.nextInt();
        }
        return ret;
    }

    static long[] fillLong(int n,FastReader fr){
        long ret[]=new long[n];
        for(int i=0;i<n;i++){
            ret[i]=fr.nextInt();
        }
        return ret;
    }

    static int max(int a,int b){
        return Math.max(a,b);
    }

    static long max(long a,long b){
        return Math.max(a,b);
    }

    static int min(int a,int b){
        return Math.min(a,b);
    }

    static long min(long a,long b){
        return Math.min(a,b);
    }

    static int modDivide(int a,int b){
        return (int) (a*Math.pow(b,MOD-2)%MOD);
    }

    static int gcd(int a,int b){
        if(b==0){
            return a;
        }
        return gcd(b,a%b);
    }

    static long gcd(long a,long b){
        if(b==0){
            return a;
        }
        return gcd(b,a%b);
    }

    static int lcm(int a,int b){
        return (a*b)/gcd(a,b);
    }

    static int longestProperPrefixSuffix(String str){
        // KMP
        int n=str.length();
        int st[]=new int[n];
        int len=0,c=1;
        while(c<n){
            if(str.charAt(len)==str.charAt(c)){
                len++;
                st[c]=len;
                c++;
            }else{
                if(len>0){
                    len=st[len-1];
                }else{
                    st[c]=0;
                    c++;
                }
            }
        }
//        out.println(Arrays.toString(st));
        return st[n-1];
    }

    static int lowerBound(int a[],int val){
        int ret=Arrays.binarySearch(a,val);
        if(ret<0){
            return -1;
        }else{
            while(ret>0 && a[ret-1]==val){
                ret--;
            }
            return ret;
        }
    }

    static int upperBound(int a[],int val){
        int ret=Arrays.binarySearch(a,val);
        if(ret<0){
            return -1;
        }else{
            while(ret<a.length-1 && a[ret+1]==val){
                ret++;
            }
            return ret;
        }
    }

    static class FastReader{
        BufferedReader br;
        StringTokenizer st;

        public FastReader() {
            br = new BufferedReader(new InputStreamReader(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());
        }

        byte nextByte(){
            return Byte.parseByte(next());
        }

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

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

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

        short nextShort(){
            return Short.parseShort(next());
        }

        Boolean nextbol(){
            return Boolean.parseBoolean(next());
        }

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