#include<iostream>
#include<cstring>
using namespace std;
#define MAX_N 5500
int n, cnt, cx, cy, cnt2;
bool x[MAX_N][MAX_N];
bool y[MAX_N][MAX_N];
int main() {
	while (cin >> n) {
		if (cnt2) { cout << endl; }
		cnt2++;
		cnt = 0;
		memset(x, true, sizeof(x));
		memset(y, false, sizeof(y));
		for (int i = 10; i < 10 + n; i++) {
			for (int j = 10; j < 10 + n; j++) {
				x[i][j] = false;
			}
		}
		cy = 10 + n;
		cx = 10;
		while (cnt <= MAX_N) {
			while (x[cy - 1][cx] == false && y[cy - 2][cx] == false && y[cy - 1][cx + 1] == false) {
				cy--;
				y[cy][cx] = true;
			}
			while (x[cy][cx + 1] == false && y[cy][cx + 2] == false) {
				cx++;
				y[cy][cx] = true;
			}
			while (x[cy + 1][cx] == false && y[cy + 2][cx] == false && y[cy + 1][cx - 1] == false) {
				cy++;
				y[cy][cx] = true;
			}
			while (x[cy][cx - 1] == false && y[cy][cx - 2] == false) {
				cx--;
				y[cy][cx] = true;
			}
			cnt++;
		}
		for (int i = 10; i < 10 + n; i++) {
			for (int j = 10; j < 10 + n; j++) {
				if (y[i][j] == true) {
					cout << '#';
				}
				else {
					cout << ' ';
				}
			}
			cout << endl;
		}
	}
}