#include<iostream>
using namespace std ;

int N , d ;
int dx[] = {0,1,0,-1} ;
int dy[] = {-1,0,1,0} ;

void func(){
	char table[110][110] ;
	
	for( int i=0 ; i<102 ; i++ ){
		for( int j=0 ; j<102 ; j++ ){
			if( i>=100-N+1 && i<=100 && j>=1 && j<=N ) table[i][j] = '#' ;
			else table[i][j] = ' ' ;
		}
	}
	
	int x = 1   ;
	int y = 100 ;
	int k = 0 ;
	bool f = true ;
	
	while(1){
		if( table[y+dy[k%4]][x+dx[k%4]] == ' ' ) break ;
		bool b = false ;
		while( table[y+dy[k%4]][x+dx[k%4]] != ' ' ){
			if( f || b ) table[y+dy[(k+1)%4]][x+dx[(k+1)%4]] = ' ' ;
			if( !b ) b = true  ;
			if(  f ) f = false ;
			x += dx[k%4] ;
			y += dy[k%4] ;
		}
		k++ ;
	}
	
	for( int i=100-N+1 ; i<=100 ; i++ ){
		for( int j=1 ; j<=N ; j++ ){
			cout << table[i][j] ;
		}
		cout << endl ;
	}
}

int main(){
	
	cin >> d ;
	while( d-- ){
		cin >> N ;
		func() ;
		if( d ) 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 ;

int N , d ;
int dx[] = {0,1,0,-1} ;
int dy[] = {-1,0,1,0} ;

void func(){
	char table[110][110] ;
	
	for( int i=0 ; i<102 ; i++ ){
		for( int j=0 ; j<102 ; j++ ){
			if( i>=100-N+1 && i<=100 && j>=1 && j<=N ) table[i][j] = '#' ;
			else table[i][j] = ' ' ;
		}
	}
	
	int x = 1   ;
	int y = 100 ;
	int k = 0 ;
	bool f = true ;
	
	while(1){
		if( table[y+dy[k%4]][x+dx[k%4]] == ' ' ) break ;
		bool b = false ;
		while( table[y+dy[k%4]][x+dx[k%4]] != ' ' ){
			if( f || b ) table[y+dy[(k+1)%4]][x+dx[(k+1)%4]] = ' ' ;
			if( !b ) b = true  ;
			if(  f ) f = false ;
			x += dx[k%4] ;
			y += dy[k%4] ;
		}
		k++ ;
	}
	
	for( int i=100-N+1 ; i<=100 ; i++ ){
		for( int j=1 ; j<=N ; j++ ){
			cout << table[i][j] ;
		}
		cout << endl ;
	}
}

int main(){
	
	cin >> d ;
	while( d-- ){
		cin >> N ;
		func() ;
		if( d ) cout << endl ;
	}
	
return 0;
}
```