#include <iostream>
#include <cstdio>
#include <vector>
#include <algorithm>
#include <complex>
#include <cstring>
#include <cstdlib>
using namespace std;

#define REP(i,n) for(int i=0;i<(int)n;++i)
#define FOR(i,c) for(__typeof((c).begin())i=(c).begin();i!=(c).end();++i)
#define ALL(c) (c).begin(), (c).end()

int main() {
  int nn;
  cin >> nn;
  REP(datan,nn) {
    int n;
    cin >> n;
    
    char c[n][n];
    memset(c,' ',sizeof(c));
    if (n==2) c[1][0] = '#';
    int dx[] = {0,1,0,-1};
    int dy[] = {-1,0,1,0};

    int x = 0, y = n - 1;

    c[x][y] = '#';
    int h = n-1;
    int d = 0;
    int j = 0;
    while(h>0) {
      REP(i,h) {
        x += dx[d];
        y += dy[d];
        c[x][y]=  '#';
      }

      if (h==1) break;
      d = (d+1)%4;
      if (j>=2 && j%2==0)
        h-=2;
      j++;
    }
    if (datan) cout << endl;
    REP(y,n) {
      REP(x,n) {
        cout << c[x][y];
      }
      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 <iostream>
#include <cstdio>
#include <vector>
#include <algorithm>
#include <complex>
#include <cstring>
#include <cstdlib>
using namespace std;

#define REP(i,n) for(int i=0;i<(int)n;++i)
#define FOR(i,c) for(__typeof((c).begin())i=(c).begin();i!=(c).end();++i)
#define ALL(c) (c).begin(), (c).end()

int main() {
  int nn;
  cin >> nn;
  REP(datan,nn) {
    int n;
    cin >> n;
    
    char c[n][n];
    memset(c,' ',sizeof(c));
    if (n==2) c[1][0] = '#';
    int dx[] = {0,1,0,-1};
    int dy[] = {-1,0,1,0};

    int x = 0, y = n - 1;

    c[x][y] = '#';
    int h = n-1;
    int d = 0;
    int j = 0;
    while(h>0) {
      REP(i,h) {
        x += dx[d];
        y += dy[d];
        c[x][y]=  '#';
      }

      if (h==1) break;
      d = (d+1)%4;
      if (j>=2 && j%2==0)
        h-=2;
      j++;
    }
    if (datan) cout << endl;
    REP(y,n) {
      REP(x,n) {
        cout << c[x][y];
      }
      cout << endl;
    }
  }
}
```