#include<cstdio>
#include<cmath>
#include<iostream>
#include<algorithm>
using namespace std;
int dx[4]={1,0,-1,0},dy[4]={0,1,0,-1};
int main(){
    int d,N;
    cin>>d;
    for(int i=0;i<d;i++){
        int N;
        cin>>N;
        char fie[200][200];
        for(int i=0;i<200;i++){
            for(int j=0;j<200;j++)fie[i][j]=' ';
        }
        for(int j=0;j<N;j++)fie[j][0]='#';
        int x=0,y=0;
        for(int j=0;;j++){
            int p=(N-1)-(j/2*2);
            if(p<=0||(p==1&&j%2==1&&N%2==0))break;
            for(int k=0;k<p;k++){
                y+=dy[j%4],x+=dx[j%4];
                fie[y][x]='#';
            }
        }
        for(int j=0;j<N;j++){
            for(int k=0;k<N;k++){
                cout<<fie[j][k];
            }
            puts("");
        }
        if(i!=d-1)puts("");
    }
}
### Prompt

Construct a CPP code solution to the problem outlined:

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<cstdio>
#include<cmath>
#include<iostream>
#include<algorithm>
using namespace std;
int dx[4]={1,0,-1,0},dy[4]={0,1,0,-1};
int main(){
    int d,N;
    cin>>d;
    for(int i=0;i<d;i++){
        int N;
        cin>>N;
        char fie[200][200];
        for(int i=0;i<200;i++){
            for(int j=0;j<200;j++)fie[i][j]=' ';
        }
        for(int j=0;j<N;j++)fie[j][0]='#';
        int x=0,y=0;
        for(int j=0;;j++){
            int p=(N-1)-(j/2*2);
            if(p<=0||(p==1&&j%2==1&&N%2==0))break;
            for(int k=0;k<p;k++){
                y+=dy[j%4],x+=dx[j%4];
                fie[y][x]='#';
            }
        }
        for(int j=0;j<N;j++){
            for(int k=0;k<N;k++){
                cout<<fie[j][k];
            }
            puts("");
        }
        if(i!=d-1)puts("");
    }
}
```