#include <iostream>
using namespace std;
int main()
{
int n; cin >> n;
int a=0;
while (a < n)
{
cout << "*";
a++;
}
cout <<"\n";
int i = 0;
while (i < n-2)
{
a = 1;
while (a <= n)
{
if (a == 1 || a == n || a== i+2)
{
cout << "*";
}
else
{
cout <<" ";
}
a++;
}
cout <<"\n";
i++;
}
a = 0;
while (a < n)
{
cout << "*";
a++;
}
return 0;
}