#include <iostream>
using namespace std;

bool field[100][100];

void migi(int y,int x,int j)
{
	for(int i=1;i<=j;i++){
		field[y][x+i] = 1;
	}
}
void sita(int y,int x,int j)
{
	if(j <= 1)
		return;
	for(int i=1;i<=j;i++){
		field[y+i][x] = 1;
	}
}
void hidari(int y,int x,int j)
{
	for(int i=1;i<=j;i++){
		field[y][x-i] = 1;
	}
}
void ue(int y,int x,int j)
{
	if(j <= 1)
		return;
	for(int i=1;i<=j;i++){
		field[y-i][x] = 1;
	}
}	
int main()
{
	int a;
	cin >> a;
	for(int i=0;i<a;i++){
		int n;
		cin >> n;
		for(int j=0;j<n;j++){
			for(int k=0;k<n;k++){
				field[j][k] = 0;
			}
		}
		int y=n-1,x=0;
		for(int j=0;j<n;j++){
			field[y-j][x] = 1;
		}
		y = 0;
		
		for(int j=n-1;j>=0;j-=2){
			migi(y,x,j);
			x = x+j;
			sita(y,x,j);
			y = y+j;			
			j-=2;
			hidari(y,x,j);
			x = x-j;
			ue(y,x,j);
			y = y-j;
		}
		
		for(int i=0;i<n;i++){
			for(int j=0;j<n;j++){
				if(field[i][j] == 1)
					cout << '#';
				else
					cout << ' ';
			}
			cout << endl;
		}
		if(i !=a-1)
			cout << endl;
	}
	return 0;
}
### Prompt

Create a solution in cpp for 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>
using namespace std;

bool field[100][100];

void migi(int y,int x,int j)
{
	for(int i=1;i<=j;i++){
		field[y][x+i] = 1;
	}
}
void sita(int y,int x,int j)
{
	if(j <= 1)
		return;
	for(int i=1;i<=j;i++){
		field[y+i][x] = 1;
	}
}
void hidari(int y,int x,int j)
{
	for(int i=1;i<=j;i++){
		field[y][x-i] = 1;
	}
}
void ue(int y,int x,int j)
{
	if(j <= 1)
		return;
	for(int i=1;i<=j;i++){
		field[y-i][x] = 1;
	}
}	
int main()
{
	int a;
	cin >> a;
	for(int i=0;i<a;i++){
		int n;
		cin >> n;
		for(int j=0;j<n;j++){
			for(int k=0;k<n;k++){
				field[j][k] = 0;
			}
		}
		int y=n-1,x=0;
		for(int j=0;j<n;j++){
			field[y-j][x] = 1;
		}
		y = 0;
		
		for(int j=n-1;j>=0;j-=2){
			migi(y,x,j);
			x = x+j;
			sita(y,x,j);
			y = y+j;			
			j-=2;
			hidari(y,x,j);
			x = x-j;
			ue(y,x,j);
			y = y-j;
		}
		
		for(int i=0;i<n;i++){
			for(int j=0;j<n;j++){
				if(field[i][j] == 1)
					cout << '#';
				else
					cout << ' ';
			}
			cout << endl;
		}
		if(i !=a-1)
			cout << endl;
	}
	return 0;
}
```