// 2011/03/15 Tazoe

#include <iostream>
using namespace std;

int main()
{
	int d;
	cin >> d;

	for(int i=0; i<d; i++){
		int n;
		cin >> n;

		char spr[100][100];
		for(int j=0; j<n; j++)
			for(int k=0; k<n; k++)
				spr[j][k] = ' ';

		int a = 0;
		int b = n+1;
		for(int j=b-2; j>=a; j--)
			spr[j][a] = '#';
		while(true){
			b -= 2;
			if(a>b)
				break;

			for(int k=a; k<=b; k++)
				spr[a][k] = '#';

			if(b-a<=1)
				break;

			for(int j=a; j<=b; j++)
				spr[j][b] = '#';

			a += 2;
			if(a>b)
				break;

			for(int k=b; k>=a; k--)
				spr[b][k] = '#';

			if(b-a<=1)
				break;

			for(int j=b; j>=a; j--)
				spr[j][a] = '#';

		}

		if(i!=0)
			cout << endl;
		for(int j=0; j<n; j++){
			for(int k=0; k<n; k++){
				cout << spr[j][k];
			}
			cout << endl;
		}
	}

	return 0;
}
### Prompt

Please create a solution in cpp 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
// 2011/03/15 Tazoe

#include <iostream>
using namespace std;

int main()
{
	int d;
	cin >> d;

	for(int i=0; i<d; i++){
		int n;
		cin >> n;

		char spr[100][100];
		for(int j=0; j<n; j++)
			for(int k=0; k<n; k++)
				spr[j][k] = ' ';

		int a = 0;
		int b = n+1;
		for(int j=b-2; j>=a; j--)
			spr[j][a] = '#';
		while(true){
			b -= 2;
			if(a>b)
				break;

			for(int k=a; k<=b; k++)
				spr[a][k] = '#';

			if(b-a<=1)
				break;

			for(int j=a; j<=b; j++)
				spr[j][b] = '#';

			a += 2;
			if(a>b)
				break;

			for(int k=b; k>=a; k--)
				spr[b][k] = '#';

			if(b-a<=1)
				break;

			for(int j=b; j>=a; j--)
				spr[j][a] = '#';

		}

		if(i!=0)
			cout << endl;
		for(int j=0; j<n; j++){
			for(int k=0; k<n; k++){
				cout << spr[j][k];
			}
			cout << endl;
		}
	}

	return 0;
}
```