#define _USE_MATH_DEFINES
#include<iostream>
#include<cstdio>
#include<algorithm>
#include<climits>
#include<string>
#include<vector>
#include<list>
#include<map>
#include<set>
#include<cmath>
#include<queue>
#include<cstring>
#include<stack>
#include<functional>
using namespace std;

const int dy[4] = {-1,0,1,0}, dx[4] = {0,1,0,-1};
int N;
bool fld[100][100];

bool end(int y,int x){
	int cnt = 0;
	for(int i=0;i<4;i++){
		int ny,nx;
		ny = y+dy[i]; nx = x+dx[i];
		if(ny<0 || N<=ny || nx<0 || N<=nx) continue;
		if(fld[ny][nx]) cnt++;
	}
	if(cnt>=2) return true;
	return false;
}

void dfs(int n,int dir,int y,int x){
	if(n<2) return;
	int cnt = 2;
	if(n==N) cnt = 3;
	for(int i=0;i<cnt;i++){
		for(int j=0;j<n-1;j++){
			y += dy[dir]; x += dx[dir];
			if(end(y,x)) return;
			fld[y][x] = true;
		}
		dir = (dir+1)%4;
	}
	dfs(n-2,dir,y,x);
}

int main(){
	cin>>N;
	fld[N-1][0] = true; dfs(N,0,N-1,0);
	for(int i=0;i<N;i++){
		for(int j=0;j<N;j++){
			if(fld[i][j]) printf("#");
			else printf(" ");
		}puts("");
	}
	return 0;
}