#include <bits/stdc++.h>
using namespace std;
int dy[]={-1,0,1,0};
int dx[]={0,1,0,-1};
int n;
char t[200][200];
   
int main(){
  int d,D;
  int i,j;
  scanf("%d",&d);
     
  for(D=0;D<d;D++){
    if(D>0)printf("\n");
       
    scanf("%d",&n);
       
    for(i=0;i<=n+3;i++){
      for(j=0;j<=n+3;j++){
        if(i==0||j==0||i==n+3||j==n+3)t[i][j]='#';
        else t[i][j]=' ';
      }
    }
       
    int y=n+1,x=2,dir=0,cnt=1;
    while(1){
      while(1){
        t[y][x]='#';
        if(t[y+dy[dir]*2][x+dx[dir]*2]=='#')break;
        cnt++;
        y+=dy[dir];
        x+=dx[dir];
      }
      if(cnt<=1)break;
      dir=(dir+1)%4;
      cnt=0;
    }
       
    for(i=2;i<2+n;i++){
      for(j=2;j<2+n;j++){
        printf("%c",t[i][j]);
      }
      printf("\n");
    }
  }
  return 0;
}
### Prompt

Please create a solution in CPP 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 <bits/stdc++.h>
using namespace std;
int dy[]={-1,0,1,0};
int dx[]={0,1,0,-1};
int n;
char t[200][200];
   
int main(){
  int d,D;
  int i,j;
  scanf("%d",&d);
     
  for(D=0;D<d;D++){
    if(D>0)printf("\n");
       
    scanf("%d",&n);
       
    for(i=0;i<=n+3;i++){
      for(j=0;j<=n+3;j++){
        if(i==0||j==0||i==n+3||j==n+3)t[i][j]='#';
        else t[i][j]=' ';
      }
    }
       
    int y=n+1,x=2,dir=0,cnt=1;
    while(1){
      while(1){
        t[y][x]='#';
        if(t[y+dy[dir]*2][x+dx[dir]*2]=='#')break;
        cnt++;
        y+=dy[dir];
        x+=dx[dir];
      }
      if(cnt<=1)break;
      dir=(dir+1)%4;
      cnt=0;
    }
       
    for(i=2;i<2+n;i++){
      for(j=2;j<2+n;j++){
        printf("%c",t[i][j]);
      }
      printf("\n");
    }
  }
  return 0;
}
```