#include<iostream>
#define rep(i,n) for(int i=0;i<n;i++)
using namespace std;
// U    0
//L R  3 1
// D    2
int n;
char d[200][200];
int dx[]={0,1,0,-1},dy[]={-1,0,1,0};
void ff(int y,int x,int dir){
	d[y][x]=' ';
	if(d[y+dy[dir]*2][x+dx[dir]*2]=='#'&&y+dy[dir]*2>=0&&y+dy[dir]*2<n&&x+dx[dir]*2>=0&&x+dx[dir]*2<n)
		ff(y+dy[dir],x+dx[dir],dir);
	else
	if(d[y+dy[(dir+1)%4]][x+dx[(dir+1)%4]]!=' '&&d[y+2*dy[(dir+1)%4]][x+2*dx[(dir+1)%4]]=='#'){
		ff(y+dy[(dir+1)%4],x+dx[(dir+1)%4],(dir+1)%4);
	}
}
int main(){
	int s;
	cin>>s;
	while(s--){
		cin>>n;
		rep(i,n)
		rep(j,n)
		d[i][j]='#';
		ff(n-1,1,0);
		rep(i,n){
		rep(j,n)
			cout<<d[i][j];
			cout<<endl;
		}
		if(s!=0)
		cout<<endl;
	}
	return 0;
}
### 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>
#define rep(i,n) for(int i=0;i<n;i++)
using namespace std;
// U    0
//L R  3 1
// D    2
int n;
char d[200][200];
int dx[]={0,1,0,-1},dy[]={-1,0,1,0};
void ff(int y,int x,int dir){
	d[y][x]=' ';
	if(d[y+dy[dir]*2][x+dx[dir]*2]=='#'&&y+dy[dir]*2>=0&&y+dy[dir]*2<n&&x+dx[dir]*2>=0&&x+dx[dir]*2<n)
		ff(y+dy[dir],x+dx[dir],dir);
	else
	if(d[y+dy[(dir+1)%4]][x+dx[(dir+1)%4]]!=' '&&d[y+2*dy[(dir+1)%4]][x+2*dx[(dir+1)%4]]=='#'){
		ff(y+dy[(dir+1)%4],x+dx[(dir+1)%4],(dir+1)%4);
	}
}
int main(){
	int s;
	cin>>s;
	while(s--){
		cin>>n;
		rep(i,n)
		rep(j,n)
		d[i][j]='#';
		ff(n-1,1,0);
		rep(i,n){
		rep(j,n)
			cout<<d[i][j];
			cout<<endl;
		}
		if(s!=0)
		cout<<endl;
	}
	return 0;
}
```