#include <vector>
#include <map>
#include <stack>
#include <queue>
#include <cstring>
#include <string>
#include <sstream>
#include <algorithm>
#include <iomanip>
#include <iostream>

#define rep(i,n) for(int i=0;i<(int)(n);i++)
const int INF = 10000000;
using namespace std;

int main()
{
	char b[100][100];
	int n, d, dx[4]={1, 0, -1, 0}, dy[4]={0, 1, 0, -1};
	
	cin >> d;
	rep(t, d) {
		memset(b, ' ', sizeof(b));
		
		cin >> n;
		rep(i, n) b[0][i]='#';
		int x=0, y=0, nn = n, direct=0;
		
		while (1) {
			for (int i=0; i<nn; i++) {
				b[x][y] = '#';
				x+=dx[direct]; y+=dy[direct];
			}
			x-=dx[direct]; y-=dy[direct];
			direct++; direct%=4;
			
			if (n%2==0 && nn<=2) break;
			
			for (int i=0; i<nn; i++) {
				b[x][y] = '#';
				x+=dx[direct]; y+=dy[direct];
			}
			x-=dx[direct]; y-=dy[direct];
			direct++; direct%=4;
			nn-=2;
			
			if (nn<=1)
				break;
		}
		
		if (t>0) cout << endl;
		rep(y, n) {
			rep(x, n)
			cout << b[x][y];
		cout << endl;
		}

	}
	return 0;
}
### Prompt

Please formulate 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 <vector>
#include <map>
#include <stack>
#include <queue>
#include <cstring>
#include <string>
#include <sstream>
#include <algorithm>
#include <iomanip>
#include <iostream>

#define rep(i,n) for(int i=0;i<(int)(n);i++)
const int INF = 10000000;
using namespace std;

int main()
{
	char b[100][100];
	int n, d, dx[4]={1, 0, -1, 0}, dy[4]={0, 1, 0, -1};
	
	cin >> d;
	rep(t, d) {
		memset(b, ' ', sizeof(b));
		
		cin >> n;
		rep(i, n) b[0][i]='#';
		int x=0, y=0, nn = n, direct=0;
		
		while (1) {
			for (int i=0; i<nn; i++) {
				b[x][y] = '#';
				x+=dx[direct]; y+=dy[direct];
			}
			x-=dx[direct]; y-=dy[direct];
			direct++; direct%=4;
			
			if (n%2==0 && nn<=2) break;
			
			for (int i=0; i<nn; i++) {
				b[x][y] = '#';
				x+=dx[direct]; y+=dy[direct];
			}
			x-=dx[direct]; y-=dy[direct];
			direct++; direct%=4;
			nn-=2;
			
			if (nn<=1)
				break;
		}
		
		if (t>0) cout << endl;
		rep(y, n) {
			rep(x, n)
			cout << b[x][y];
		cout << endl;
		}

	}
	return 0;
}
```