#include <iostream>
#include <vector>
using namespace std;

void draw(int width, int x, int y, vector<string>& a) {
    if (width == 1) {
        a[x][y] = '#';
    } else if (width == 2) {
        a[x][y] = a[x+1][y] = a[x][y+1] = '#';
    } else if (width == 3) {
        a[x][y] = a[x][y+1] = a[x][y+2] = '#';
        a[x+1][y] = a[x+1][y+2] = '#';
        a[x+2][y] = a[x+2][y+2] = '#';
    } else if (width == 4) {
        a[x][y] = a[x][y+1] = a[x][y+2] = a[x][y+3] = '#';
        a[x+1][y] = a[x+1][y+3] = '#';
        a[x+2][y] = a[x+2][y+3] = '#';
        a[x+3][y] = a[x+3][y+2] = a[x+3][y+3] = '#';
    } else {
        for (int j = 0; j < width; ++j) {
            a[x][y+j] = '#';
        }
        for (int j = 1; j < width; ++j) {
            a[x+j][y] = '#';
            a[x+j][y+width-1] = '#';
        }
        for (int j = 2; j < width; ++j) {
            a[x+width-1][y+j] = '#';
        }
        a[x+width-2][y+2] = '#';
        draw(width-4, x+2, y+2, a);
    }
}

int main() {
    int N;
    cin >> N;
    for (;N--;) {
        int W;
        cin >> W;
        vector<string> a(W, string(W, ' '));

        draw(W, 0, 0, a);
        for (int j = 0; j < W; ++j) {
            cout << a[j] << endl;
        }
        if (N > 0) {
            cout << endl;
        }
    }
    return 0;
}
### Prompt

Generate a cpp solution to the following problem:

I decided to create a program that displays a "round and round pattern". The "round and round pattern" is as follows.

* If the length of one side is n, it is displayed as a character string with n rows and n columns.
* A spiral pattern that rotates clockwise with the lower left corner as the base point.
* The part with a line is represented by # (half-width sharp), and the blank part is represented by "" (half-width blank).
* Leave a space between the lines.



Create a program that takes an integer n as an input and outputs a "round and round pattern" with a side length of n.



Input

The input is given in the following format:


d
n1
n2
::
nd


The number of datasets d (d ≤ 20) is given to the first line, and the side length ni (1 ≤ ni ≤ 100) of the i-th round pattern is given to each of the following d lines.

Output

Please output a round and round pattern for each data set. Insert a blank line between the datasets.

Example

Input

2
5
6


Output

#####
#   #
# # #
# # #
# ###

######
#    #
# ## #
# #  #
# #  #
# ####

### Response

```cpp
#include <iostream>
#include <vector>
using namespace std;

void draw(int width, int x, int y, vector<string>& a) {
    if (width == 1) {
        a[x][y] = '#';
    } else if (width == 2) {
        a[x][y] = a[x+1][y] = a[x][y+1] = '#';
    } else if (width == 3) {
        a[x][y] = a[x][y+1] = a[x][y+2] = '#';
        a[x+1][y] = a[x+1][y+2] = '#';
        a[x+2][y] = a[x+2][y+2] = '#';
    } else if (width == 4) {
        a[x][y] = a[x][y+1] = a[x][y+2] = a[x][y+3] = '#';
        a[x+1][y] = a[x+1][y+3] = '#';
        a[x+2][y] = a[x+2][y+3] = '#';
        a[x+3][y] = a[x+3][y+2] = a[x+3][y+3] = '#';
    } else {
        for (int j = 0; j < width; ++j) {
            a[x][y+j] = '#';
        }
        for (int j = 1; j < width; ++j) {
            a[x+j][y] = '#';
            a[x+j][y+width-1] = '#';
        }
        for (int j = 2; j < width; ++j) {
            a[x+width-1][y+j] = '#';
        }
        a[x+width-2][y+2] = '#';
        draw(width-4, x+2, y+2, a);
    }
}

int main() {
    int N;
    cin >> N;
    for (;N--;) {
        int W;
        cin >> W;
        vector<string> a(W, string(W, ' '));

        draw(W, 0, 0, a);
        for (int j = 0; j < W; ++j) {
            cout << a[j] << endl;
        }
        if (N > 0) {
            cout << endl;
        }
    }
    return 0;
}
```