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.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.math.BigInteger;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.LinkedHashMap;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.Random;
import java.util.Set;
import java.util.Stack;
import java.util.StringTokenizer;
import java.util.stream.Collectors;


/*
 * @author: Ramanqul
 * */
public class Main {
    private static final double EPS = .000000001;

    private static int findLower(long arr[], long x) {
        int l = -1, r = arr.length;

        while (r > l+1) {
            int mid = (l+r)/2;

            if (arr[mid] >= x) {
                r = mid;
            } else {
                l = mid;
            }
        }

        return r;
    }

    private static int binarySearch(Integer arr[][], int arrIdx, int key) {
        int l = 0, r = arr.length-1;

        while (l<=r) {
            int m = (l+r)/2;
            if (arr[m][arrIdx] < key) {
                l = m + 1;
            } else if (arr[m][arrIdx] > key) {
                r = m - 1;
            } else {
                return m;
            }
        }

        return -1;
    }

    private static int findUpper(int arr[], int x) {
        int l = -1, r = arr.length;

        while (r > l+1) {
            int mid = (l+r)/2;

            if (arr[mid] < x) {
                l = mid;
            } else {
                r = mid;
            }
        }

        return r;
    }

    private static boolean USE_TEST_CASES = true;

    private static void swap(List<Integer> list, int i, int j) {
        int t = list.get(i);
        list.set(i, list.get(j));
        list.set(j, t);
    }

    private static int sum(List<Integer> list, int ... indices) {
        int sum = 0;
        for (int i: indices) {
            sum += Math.abs(list.get(i));
        }
        return sum;
    }

    private static int prefixSum(int p[], int start, int end) {
        if (start == 0) {
            return p[end];
        }

        return p[end] - p[start-1];
    }

    private static void solve(final int testCase, MyScanner in, PrintWriter out) {
        int n = in.nextInt();
        char grid[][] = new char[n][n];

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

        int x1=-1,y1=-1,x2=-1,y2=-1;

        for (int i=0;i<n;i++) {
            for (int j=0;j<n;j++) {
                if (grid[i][j] == '*') {
                    if (x1 == -1) {
                        x1=j;
                        y1=i;
                    } else {
                        x2=j;
                        y2=i;
                        break;
                    }
                }
            }
        }

        if (x1 == x2) {
            if (x1 + 1 >= n) {
                grid[y1][x1-1] = '*';
                grid[y2][x1-1] = '*';
            } else {
                grid[y1][x1+1] = '*';
                grid[y2][x1+1] = '*';
            }
        } else if (y1 == y2) {
            if (y1+1 >= n) {
                grid[y1-1][x1] = '*';
                grid[y1-1][x2] = '*';
            } else {
                grid[y1+1][x1] = '*';
                grid[y1+1][x2] = '*';
            }
        } else {
            grid[y1][x2] = '*';
            grid[y2][x1] = '*';
        }

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

    private static void generateInput(String fileName) throws IOException {
        PrintWriter writer = new PrintWriter(new BufferedOutputStream(new FileOutputStream(fileName)));

        writer.println(1);
        final int n = 200_000;
        Random rnd = new Random();
        writer.println(n);

        for (int i=0;i<n;i++) {
            writer.print(rnd.nextInt(1+100));
            writer.print(" ");
        }

        writer.close();
    }

    public static void main(String[] args) throws IOException {
//        String fileName = "sample.in";

//        generateInput(fileName);

        MyScanner sc = new MyScanner();//new BufferedInputStream(new FileInputStream(fileName)));

        PrintWriter out = new PrintWriter(new BufferedOutputStream(System.out));
        int t = 1;

        if (USE_TEST_CASES) {
            t = sc.nextInt();
        }

        for (int i=0;i<t;i++) {
            solve(i, sc, out);
        }

        out.close();
    }

    private static class Pair<A,B> {
        public A first;
        public B second;
        public Pair(A first, B second) {
            this.first = first;
            this.second = second;
        }
    }

    private static class Triple<A,B,C> {
        public A first;
        public B second;
        public C third;

        public Triple(A first, B second, C third) {
            this.first = first;
            this.second = second;
            this.third = third;
        }
    }

    private static class TreeNode {
        public int val;
        public TreeNode left;
        public TreeNode right;

        public TreeNode() {}
        public TreeNode(int val) {
            this.val = val;
        }
    }

    private static class H {
        public static void readArray(MyScanner in, int a[], int n) {
            for (int i=0;i<n;i++) {
                a[i] = in.nextInt();
            }
        }

        public static boolean isUnique(int ... nums) {
            Set<Integer> s = new HashSet<>();
            for (int i:nums) {
                if (s.contains(i)) {
                    return false;
                }
                s.add(i);
            }

            return true;
        }


        public static Pair<Integer, Integer>[] readIntPairs(MyScanner in, int n) {
            Pair[] pairs = new Pair[n];
            for (int i=0;i<n;i++) {
                int x = in.nextInt();
                int y = in.nextInt();
                pairs[i] = new Pair<Integer, Integer>(x, y);
            }

            return pairs;
        }

        public static List<Integer> dfs(int start, List<Integer>[] adj) {
            boolean v[] = new boolean[adj.length+1];

            List<Integer> res = new ArrayList<>();

            Stack<Integer> st = new Stack<>();

            st.push(start);

            while (!st.isEmpty()) {
                int x = st.pop();
                if (!v[x]) {
                    res.add(x);
                    boolean allVisited = true;
                    for (int e: adj[x]) {
                        if (!v[e]) {
                            st.push(e);
                            allVisited = false;
                        }
                    }

                    if (allVisited) {
                        break;
                    }

                    v[x] = true;
                } else {
                    break;
                }
            }

            return res;
        }

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

            return gcd(b%a, a);
        }

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

    private static class MyScanner {
        BufferedReader br;
        StringTokenizer st;

        public MyScanner() {
            br = new BufferedReader(new InputStreamReader(System.in));
        }
        public MyScanner(InputStream is) {
            br = new BufferedReader(new InputStreamReader(is));
        }

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

    }
}