#include <iostream>
using namespace std;

ostream &printHex(ostream &out, size_t size) {
    static const char borderChar = '#';
    static const char fillChar = '.';
    static const char indentationChar = ' ';

    out << string(size-1, indentationChar) << string(size, borderChar) << endl;
    if (size<=1)
         return out; 
    for (size_t line=1; line<size-1; ++line) {
        out << string(size-1-line, indentationChar) << borderChar << string(size+2*(line-1), fillChar) << borderChar<< endl;
    }
    for (size_t line=size-1; line>0; --line) {
        out << string(size-1-line, indentationChar) << borderChar << string(size+2*(line-1), fillChar) << borderChar << endl;
    }
    out << string(size-1, indentationChar) << string(size, borderChar) << endl;
    return out;
}
int main() {
    size_t size;

    while(cin>>size) {
       printHex(cout, size) << endl;
    }
    return 0;
}