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


*.*.
....
*.*.
....
**
**
**
**
*.*
*.*
...
.....
.**..
.....
.**..
.....
....
....
**..
**..
#include <bits/stdc++.h>

#define modulus 1000000007

//for loops
//-------------------
#define for0(i, N) for (i = 0; i < (int) N; i++)
#define for1(i, N) for (i = 1; i <= (int) N; i++)
#define forr0(i, N) for (i = (int) N - 1; ~i; i--)
#define forr1(i, N) for (i = (int) N; i; i--)
#define foru(i, l, r, x) for (i = l; i <= r; i += x)
//to declare a for loop,
//first declare the primitive on a separate line
//
// int i;
// for0(i, N){
//      code
// }


//primitives & string
//-------------------
using ll = long long;
using str = std::string;


//pairs
//-----
using ii = std::pair<int, int>;
using llll = std::pair<ll, ll>;
#define mp make_pair
#define fi first
#define se second

using mii = std::map<int, int>;
using mllll = std::map<ll, ll>;


//vectors
//-------------
#define pb push_back
using vi = std::vector<int>;
using vvi = std::vector<vi>;
using vii = std::vector<ii>;
using vll = std::vector<ll>;
using vvll = std::vector<vll>;
using vb = std::vector<bool>;


//those grid problems (thanks BenCh)
//----------------------------------
const int dx[] = {1, 0, -1, 0},  dy[] = {0, 1, 0, -1};


//division rounded up and rounded down
//--------
ll cdiv(ll a, ll b) { return a/b+((a^b)>0&&a%b); }
ll fdiv(ll a, ll b) { return a/b-((a^b)<0&&a%b); }


using namespace std;

//ACTUAL CODE
//------------------------------------------------------------------------------------------------
//                                                                                                |
//                                                                                                |




void solve(){

    int N; cin >> N;
    vector<pair<int, int>> coords;
    char arr[N][N];
    for (int i = 0; i < N; i++) {
        for (int j = 0; j < N; j++) {
            cin >> arr[i][j];
            if (arr[i][j] == '*') {
                coords.pb({i, j});
            }
        }
    }

    if (coords[0].first == coords[1].first) {
        if (coords[1].first == N - 1) {
            arr[N - 2][coords[1].second] = '*';
            arr[N - 2][coords[0].second] = '*';
        }
        else {
            arr[coords[1].first + 1][coords[1].second] = '*';
            arr[coords[0].first + 1][coords[0].second] = '*';
        }
    }
    else if (coords[0].second == coords[1].second) {
            if (coords[0].second == N - 1) {
                arr[coords[0].first][N - 2] = '*';
                arr[coords[1].first][N - 2] = '*';
            }
            else {
                arr[coords[0].first][coords[0].second + 1] = '*';
                arr[coords[1].first][coords[1].second + 1] = '*';
            }
        }
    else {
        arr[coords[0].first][coords[1].second] = '*';
        arr[coords[1].first][coords[0].second] = '*';
    }

    for (int i = 0; i < N; i++) {
        for (int j = 0; j < N; j++) {
            cout << arr[i][j];
        }
        cout << "\n";
    }

}

int main()
{
    std::ios::sync_with_stdio(0);
    std::cin.tie(0); std::cout.tie(0); std::cout << std::fixed;

    int t; std::cin >> t;
    while(t--) solve();

    return 0;
}






//                                                                                                |
//                                                                                                |
//------------------------------------------------------------------------------------------------




//  NOTES:
//~~~~~~~~~~~~~~~~~~~~~~~~
// debug:
// - check int overflow, out of bounds
// - negative indexing?
//  special cases (n = 1, n = 0?)
//  do something instead of nothing
//  *stay organized*
// - write down IDEAS
// - DON'T GET CAUGHT ON ONE APPROACH
//
//
//
// most of all, maintain absolute concentration - take a break if you must
//
//
