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>

using namespace std;

#define pll pair<ll, ll>
#define mod 1000000007
#define mp make_pair
#define ll long long int
#define pb push_back
#define ppb pop_back
#define rep(i, a, n) for (ll i = a; i < n; i++)
#define repr(i, n, a) for (ll i = n; i > a; i--)
#define vll vector<ll>
#define yes cout << "YES\n"
#define no cout << "NO\n"
#define F first
#define S second

ll gcd(ll x, ll y)
{ //returns gcd of two long long ints
    if (x == 0)
        return y;
    return gcd(y % x, x);
}

ll lcm(ll x, ll y)
{
    return ((x * y) / gcd(x, y));
}

bool isPrime(ll n)
{
    // Corner case
    if (n <= 1)
        return false;

    // Check from 2 to n-1
    for (ll i = 2; i * i < n + 1; i++)
        if (n % i == 0)
            return false;

    return true;
}

ll fact(ll n);

ll nCr(ll n, ll r)
{
    return fact(n) / (fact(r) * fact(n - r));
}

// Returns factorial of n
ll fact(ll n)
{
    ll res = 1;
    for (ll i = 2; i <= n; i++)
        res = res * i;
    return res;
}

int powermod(int x, int y, int p)
{
    int res = 1; // Initialize result

    x = x % p; // Update x if it is more than or
    // equal to p

    while (y > 0)
    {
        // If y is odd, multiply x with result
        if (y & 1)
            res = (res * x) % p;

        // y must be even now
        y = y >> 1; // y = y/2
        x = (x * x) % p;
    }
    return res;
}

int modInverse(int n, int p)
{
    return powermod(n, p - 2, p);
}

int nCrModPFermat(int n, int r, int p)
{
    // Base case
    if (r == 0)
        return 1;

    // Fill factorial array so that we
    // can find all factorial of r, n
    // and n-r
    int fac[n + 1];
    fac[0] = 1;
    for (int i = 1; i <= n; i++)
        fac[i] = (fac[i - 1] * i) % p;

    return (fac[n] * modInverse(fac[r], p) % p * modInverse(fac[n - r], p) % p) % p;
}

vll all_prime(ll n)
{
    vll sieve(n + 1, 0);
    for (ll i = 2; i < n + 1; i++)
    {
        if (sieve[i])
            continue; /* If seive[i]==0 it means its a prime */
        for (ll j = i * i; j < n + 1; j += i)
        {
            if (sieve[j] == 0)
            {
                sieve[j] = i;
            }
        }
    }
    return sieve;
}

vector<ll> factors(ll n)
{
    vector<ll> f;
    for (ll x = 2; x * x <= n; x++)
    {
        while (n % x == 0)
        {
            f.push_back(x);
            n /= x;
        }
    }
    if (n > 1)
        f.push_back(n);
    return f;
}

//***************************** CODE STARTS HERE **************************************

void solve()
{
    ll n;
    cin >> n;
    vector<string> a;
    rep(i, 0, n)
    {
        string s;
        cin >> s;
        a.pb(s);
    }
    int f = -1, s = -1, o = -1, k = -1;
    rep(i, 0, n)
    {
        string t = a[i];
        rep(j, 0, t.size())
        {
            if (t[j] == '*')
            {
                if (f == -1)
                    f = i, o = j;
                else
                    s = i, k = j;
            }
        }
    }

    string t = a[f];
    t[k] = '*';
    a[f] = t;
    t = a[s];
    t[o] = '*';
    a[s] = t;
    if (f == s)
    {
        if (f != n - 1)
            f++, s++;
        else
            f--, s--;
        t = a[f];
        t[k] = '*';
        a[f] = t;
        t = a[s];
        t[o] = '*';
        a[s] = t;
    }
    if (o == k)
    {
        string m = a[f];
        if (o != m.size() - 1)
            o++;
        else
            o--;
        m = a[s];
        if (k != m.size() - 1)
            k++;
        else
            k--;
        t = a[f];
        t[k] = '*';
        a[f] = t;
        t = a[s];
        t[o] = '*';
        a[s] = t;
    }

    rep(i, 0, n) cout << a[i] << endl;

    return;
}

int main()
{
    ios::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    ll t = 1;
    cin >> t;
    while (t--)
    {
        solve();
    }
    return 0;
}
