#include <iostream>

using namespace std;

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);

    int n;
    if (cin >> n) {
        for (int i = 1; i <= n; ++i) {
            for (int j = 1; j <= n; ++j) {
                if (j == 1 || j == n || i == j) {
                    cout << '*';
                } else {
                    cout << ' ';
                }
            }
            cout << "\n";
        }
    }

    return 0;
}