#include<iostream>
#include<cstdio>
#include<algorithm>
#include<string>
#include<vector>
using namespace std;

int dx[4] = { -1,0,1,0 }, dy[4] = { 0,1,0,-1 };
int main() {
	int a;
	cin >> a;
	for (int b = 0; b < a; b++) {
		if (b)cout << endl;
		int c;
		cin >> c;
		bool d[100][100]{};
		int x = c - 1, y = 0;
		for (int i = 0;i<10000; i++) {
			while (1) {
				d[x][y] = true;
				if (x + dx[i%4] < 0 || x + dx[i%4] >= c || y + dy[i%4] < 0 || y + dy[i%4] >= c)break;
				int sum = 0;
				for (int p = 0; p < 4; p++) {
					if (x + dx[i % 4] + dx[p] >= 0 && x + dx[i % 4] + dx[p] < c && y + dy[i % 4] + dy[p] >= 0 && y + dy[i % 4] + dy[p] < c&&d[x + dx[i % 4] + dx[p]][y + dy[i % 4] + dy[p]]) {
						sum++;
					}
				}
				if (sum > 1)break;
				x += dx[i % 4]; y += dy[i % 4];
			}
		}
		for (int k = 0; k < c; k++) {
			for (int l = 0; l < c; l++) {
				if (d[k][l])cout << "#";
				else cout << " ";
			}
			cout << endl;
		}
	}
}
### Prompt

In Cpp, your task is to solve 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<cstdio>
#include<algorithm>
#include<string>
#include<vector>
using namespace std;

int dx[4] = { -1,0,1,0 }, dy[4] = { 0,1,0,-1 };
int main() {
	int a;
	cin >> a;
	for (int b = 0; b < a; b++) {
		if (b)cout << endl;
		int c;
		cin >> c;
		bool d[100][100]{};
		int x = c - 1, y = 0;
		for (int i = 0;i<10000; i++) {
			while (1) {
				d[x][y] = true;
				if (x + dx[i%4] < 0 || x + dx[i%4] >= c || y + dy[i%4] < 0 || y + dy[i%4] >= c)break;
				int sum = 0;
				for (int p = 0; p < 4; p++) {
					if (x + dx[i % 4] + dx[p] >= 0 && x + dx[i % 4] + dx[p] < c && y + dy[i % 4] + dy[p] >= 0 && y + dy[i % 4] + dy[p] < c&&d[x + dx[i % 4] + dx[p]][y + dy[i % 4] + dy[p]]) {
						sum++;
					}
				}
				if (sum > 1)break;
				x += dx[i % 4]; y += dy[i % 4];
			}
		}
		for (int k = 0; k < c; k++) {
			for (int l = 0; l < c; l++) {
				if (d[k][l])cout << "#";
				else cout << " ";
			}
			cout << endl;
		}
	}
}
```