#include <stdio.h>
#include <iostream>
#include <algorithm>
#include <iomanip>
#include <map>
#include <fstream>
#include <sstream>
#include <math.h>
#include <queue>
#include <stack>
#include <math.h>
#include <string.h>

/*
 
 #####
 #   #
 # # #
 # # #
 # ###
 
 ######
 #    #
 # ## #
 # #  #
 # #  #
 # ####
 
 */
using namespace std;


void f(char guruguru[100][100], int l, int d, int x, int y){
    while(1){
        if(l<=0)return;
        
        if(d==0){//右下
            for(int i=0; i<l; i++){
                guruguru[y][x+i]='#';
            }
            x=x+(l-1);
            
            if(l==2)return;
            
            for(int i=0; i<l; i++){
                guruguru[y+i][x]='#';
            }
            y=y+(l-1);
            l=l-2;
            d=1;
            //f(guruguru,l,d,x,y);
        }
        
        if(d==1){//左上
            
            
            for(int i=0; i<l; i++){
                guruguru[y][x-i]='#';
            }
            x=x-(l-1);
            
            if(l<=2)return;
            
            for(int i=0; i<l; i++){
                guruguru[y-i][x]='#';
            }
            y=y-(l-1);
            
            l=l-2;
            d=0;
            //f(guruguru,l,d,x,y);
        }
    }
}

void f0(char guruguru[100][100], int l, int d, int x, int y){
    for(int i=0; i<l; i++){
        guruguru[i][0]='#';
    }
    
    f(guruguru,l,0,0,0);
}

/*
 int main(){
 
 for(int i=0; i<100; i++){
 for(int j=0; j<100; j++){
 guruguru_0[i][j]=' ';
 guruguru_1[i][j]=' ';
 guruguru_2[i][j]=' ';
 guruguru_3[i][j]=' ';
 }
 }
 
 
 //f0(guruguru_0, 100, 0, 0, 0);
 //f0(guruguru_3, 99, 0, 0, 0);
 //f0(guruguru_2, 98, 0, 0, 0);
 //f0(guruguru_1, 97, 0, 0, 0);
 
 
 
 int n;
 cin>>n;
 for(int roop=0; roop<n; roop++){
 int l;
 cin>>l;
 if(l%4==0){
 int x=50-l/2;
 int y=50-l/2;
 for(int i=y; i<y+l; i++){
 for(int j=x; j<x+l; j++){
 cout<<guruguru_0[i][j];
 }
 cout<<endl;
 }
 cout<<endl;
 }else if(l%4==1){
 int x=50-l/2-2;
 int y=50-l/2-2;
 for(int i=y; i<y+l; i++){
 for(int j=x; j<x+l; j++){
 cout<<guruguru_1[i][j];
 }
 cout<<endl;
 }
 cout<<endl;
 } else if(l%4==2){
 int x=50-l/2-1;
 int y=50-l/2-1;
 for(int i=y; i<y+l; i++){
 for(int j=x; j<x+l; j++){
 cout<<guruguru_2[i][j];
 }
 cout<<endl;
 }
 cout<<endl;
 }else if(l%4==3){
 int x=50-l/2-1;
 int y=50-l/2-1;
 for(int i=y; i<y+l; i++){
 for(int j=x; j<x+l; j++){
 cout<<guruguru_3[i][j];
 }
 cout<<endl;
 }
 cout<<endl;
 }
 }
 
 }
 */
int main(){
    
    int n;
    cin>>n;
    for(int roop=0; roop<n; roop++){
        int l;
        cin>>l;
        char guruguru[100][100];
        //memcpy(guruguru,init,sizeof(init));
        for(int i=0; i<l; i++){
            for(int j=0; j<l; j++){
                guruguru[i][j]=' ';
            }
        }
        
        f0(guruguru,l,0,0,0);
        
        for(int i=0; i<l; i++){
            for(int j=0; j<l; j++){
                cout<<guruguru[i][j];
            }
            cout<<endl;
        }
        if(roop==n-1)break;
        cout<<endl;
    }
}
### Prompt

Your task is to create a Cpp solution 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
#include <stdio.h>
#include <iostream>
#include <algorithm>
#include <iomanip>
#include <map>
#include <fstream>
#include <sstream>
#include <math.h>
#include <queue>
#include <stack>
#include <math.h>
#include <string.h>

/*
 
 #####
 #   #
 # # #
 # # #
 # ###
 
 ######
 #    #
 # ## #
 # #  #
 # #  #
 # ####
 
 */
using namespace std;


void f(char guruguru[100][100], int l, int d, int x, int y){
    while(1){
        if(l<=0)return;
        
        if(d==0){//右下
            for(int i=0; i<l; i++){
                guruguru[y][x+i]='#';
            }
            x=x+(l-1);
            
            if(l==2)return;
            
            for(int i=0; i<l; i++){
                guruguru[y+i][x]='#';
            }
            y=y+(l-1);
            l=l-2;
            d=1;
            //f(guruguru,l,d,x,y);
        }
        
        if(d==1){//左上
            
            
            for(int i=0; i<l; i++){
                guruguru[y][x-i]='#';
            }
            x=x-(l-1);
            
            if(l<=2)return;
            
            for(int i=0; i<l; i++){
                guruguru[y-i][x]='#';
            }
            y=y-(l-1);
            
            l=l-2;
            d=0;
            //f(guruguru,l,d,x,y);
        }
    }
}

void f0(char guruguru[100][100], int l, int d, int x, int y){
    for(int i=0; i<l; i++){
        guruguru[i][0]='#';
    }
    
    f(guruguru,l,0,0,0);
}

/*
 int main(){
 
 for(int i=0; i<100; i++){
 for(int j=0; j<100; j++){
 guruguru_0[i][j]=' ';
 guruguru_1[i][j]=' ';
 guruguru_2[i][j]=' ';
 guruguru_3[i][j]=' ';
 }
 }
 
 
 //f0(guruguru_0, 100, 0, 0, 0);
 //f0(guruguru_3, 99, 0, 0, 0);
 //f0(guruguru_2, 98, 0, 0, 0);
 //f0(guruguru_1, 97, 0, 0, 0);
 
 
 
 int n;
 cin>>n;
 for(int roop=0; roop<n; roop++){
 int l;
 cin>>l;
 if(l%4==0){
 int x=50-l/2;
 int y=50-l/2;
 for(int i=y; i<y+l; i++){
 for(int j=x; j<x+l; j++){
 cout<<guruguru_0[i][j];
 }
 cout<<endl;
 }
 cout<<endl;
 }else if(l%4==1){
 int x=50-l/2-2;
 int y=50-l/2-2;
 for(int i=y; i<y+l; i++){
 for(int j=x; j<x+l; j++){
 cout<<guruguru_1[i][j];
 }
 cout<<endl;
 }
 cout<<endl;
 } else if(l%4==2){
 int x=50-l/2-1;
 int y=50-l/2-1;
 for(int i=y; i<y+l; i++){
 for(int j=x; j<x+l; j++){
 cout<<guruguru_2[i][j];
 }
 cout<<endl;
 }
 cout<<endl;
 }else if(l%4==3){
 int x=50-l/2-1;
 int y=50-l/2-1;
 for(int i=y; i<y+l; i++){
 for(int j=x; j<x+l; j++){
 cout<<guruguru_3[i][j];
 }
 cout<<endl;
 }
 cout<<endl;
 }
 }
 
 }
 */
int main(){
    
    int n;
    cin>>n;
    for(int roop=0; roop<n; roop++){
        int l;
        cin>>l;
        char guruguru[100][100];
        //memcpy(guruguru,init,sizeof(init));
        for(int i=0; i<l; i++){
            for(int j=0; j<l; j++){
                guruguru[i][j]=' ';
            }
        }
        
        f0(guruguru,l,0,0,0);
        
        for(int i=0; i<l; i++){
            for(int j=0; j<l; j++){
                cout<<guruguru[i][j];
            }
            cout<<endl;
        }
        if(roop==n-1)break;
        cout<<endl;
    }
}
```